{"id":1231,"date":"2023-05-28T04:10:16","date_gmt":"2023-05-27T20:10:16","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1231"},"modified":"2023-05-28T04:10:16","modified_gmt":"2023-05-27T20:10:16","slug":"springboot-%e7%b3%bb%e5%88%97%e6%95%99%e7%a8%8b%e4%b9%8b%e5%ae%9a%e4%b9%89%e6%8e%a5%e5%8f%a3%e8%bf%94%e5%9b%9e%e7%b1%bb%e5%9e%8b%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/springboot-%e7%b3%bb%e5%88%97%e6%95%99%e7%a8%8b%e4%b9%8b%e5%ae%9a%e4%b9%89%e6%8e%a5%e5%8f%a3%e8%bf%94%e5%9b%9e%e7%b1%bb%e5%9e%8b%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f\/","title":{"rendered":"SpringBoot \u7cfb\u5217\u6559\u7a0b\u4e4b\u5b9a\u4e49\u63a5\u53e3\u8fd4\u56de\u7c7b\u578b\u7684\u51e0\u79cd\u65b9\u5f0f"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;color: black;padding: 0 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;\">\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.3333333333333333\"  data-type=\"jpeg\" data-w=\"960\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040602718.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.3333333333333333\"  data-type=\"jpeg\" data-w=\"960\" style=\"display: block;margin: 0px auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040602718.jpeg\"><\/noscript><\/figure>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;display: block;font-size: 0.9em;overflow: auto;border-left: 3px solid rgb(239, 112, 96);color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;background: rgb(255, 249, 249);\">\n<p style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0px;color: black;line-height: 26px;\">SpringBoot \u7cfb\u5217\u6559\u7a0b\u4e4b\u5b9a\u4e49\u63a5\u53e3\u8fd4\u56de\u7c7b\u578b\u7684\u51e0\u79cd\u65b9\u5f0f<\/p>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><br  \/><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5b9e\u73b0\u4e00\u4e2a web \u63a5\u53e3\u8fd4\u56de json \u6570\u636e\uff0c\u57fa\u672c\u4e0a\u662f\u6bcf\u4e00\u4e2a javaer \u975e\u5e38\u719f\u6089\u7684\u4e8b\u60c5\u4e86\uff1b\u90a3\u4e48\u95ee\u9898\u6765\u4e86\uff0c\u5982\u679c\u6211\u6709\u4e00\u4e2a\u63a5\u53e3\uff0c\u9664\u4e86\u5e0c\u671b\u8fd4\u56de json \u683c\u5f0f\u7684\u6570\u636e\u4e4b\u5916\uff0c\u82e5\u4e5f\u5e0c\u671b\u53ef\u4ee5\u8fd4\u56de xml \u683c\u5f0f\u6570\u636e\u53ef\u884c\u4e48\uff1f<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u7b54\u6848\u5f53\u7136\u662f\u53ef\u884c\u7684\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u4e00\u4e2a\u63a5\u53e3\u7684\u8fd4\u56de\u6570\u636e\u7c7b\u578b\uff0c\u53ef\u4ee5\u600e\u4e48\u5904\u7406<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;text-align: center;\"><span style=\"display: none;\"><\/span><span style=\"display: inline-block;font-weight: bold;color: #000000;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;\">I. \u9879\u76ee\u642d\u5efa<\/span><span style=\"display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;\"> <\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u672c\u6587\u521b\u5efa\u7684\u5b9e\u4f8b\u5de5\u7a0b\u91c7\u7528<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">SpringBoot 2.2.1.RELEASE<\/code> + <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">maven 3.5.3<\/code> + <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">idea<\/code>\u8fdb\u884c\u5f00\u53d1<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">1. pom \u4f9d\u8d56<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5177\u4f53\u7684 SpringBoot \u9879\u76ee\u5de5\u7a0b\u521b\u5efa\u5c31\u4e0d\u8d58\u8ff0\u4e86\uff0c\u5bf9\u4e8e pom \u6587\u4ef6\u4e2d\uff0c\u9700\u8981\u91cd\u70b9\u5173\u6ce8\u4e0b\u9762\u4e24\u4e2a\u4f9d\u8d56\u7c7b<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">dependencies<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">dependency<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">groupId<\/span>&gt;<\/span>org.springframework.boot<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">groupId<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">artifactId<\/span>&gt;<\/span>spring-boot-starter-web<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">artifactId<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">dependency<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">dependency<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">groupId<\/span>&gt;<\/span>com.fasterxml.jackson.dataformat<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">groupId<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">artifactId<\/span>&gt;<\/span>jackson-dataformat-xml<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">artifactId<\/span>&gt;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">dependency<\/span>&gt;<\/span><br  \/><span style=\"color: #000080;font-weight: normal;line-height: 26px;\">&lt;\/<span style=\"color: #000080;font-weight: normal;line-height: 26px;\">dependencies<\/span>&gt;<\/span><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6ce8\u610f <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">jackson-datafromat-xml<\/code>\u8fd9\u4e2a\u4f9d\u8d56\uff0c\u52a0\u4e0a\u8fd9\u4e2a\u4e3b\u8981\u662f\u4e3a\u4e86\u652f\u6301\u8fd4\u56de xml \u683c\u5f0f\u7684\u6570\u636e<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;text-align: center;\"><span style=\"display: none;\"><\/span><span style=\"display: inline-block;font-weight: bold;color: #000000;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;\">II. \u8fd4\u56de\u7c7b\u578b\u8bbe\u7f6e\u7684\u591a\u79cd\u65b9\u5f0f<\/span><span style=\"display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;\"> <\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6b63\u5e38\u6765\u8bb2\uff0c\u4e00\u4e2a RestController \u7684\u63a5\u53e3\uff0c\u9ed8\u8ba4\u8fd4\u56de\u7684\u662f Json \u683c\u5f0f\u6570\u636e\uff0c\u5f53\u6211\u4eec\u5f15\u5165\u4e86\u4e0a\u9762\u7684 xml \u5305\u4e4b\u540e\uff0c\u4f1a\u600e\u6837\u5462\uff1f\u8fd4\u56de\u7684\u8fd8\u662f json \u4e48\uff1f<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">1.\u901a\u8fc7 produce \u8bbe\u7f6e\u8fd4\u56de\u7c7b\u578b<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5982\u679c\u4e00\u4e2a\u63a5\u53e3\u5e0c\u671b\u8fd4\u56de json \u6216\u8005 xml \u683c\u5f0f\u7684\u6570\u636e\uff0c\u6700\u5bb9\u6613\u60f3\u5230\u7684\u65b9\u5f0f\u5c31\u662f\u76f4\u63a5\u8bbe\u7f6e<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">RequestMapping<\/code>\u6ce8\u89e3\u4e2d\u7684 produce \u5c5e\u6027<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u8fd9\u4e2a\u503c\u4e3b\u8981\u5c31\u662f\u7528\u6765\u8bbe\u7f6e\u8fd9\u4e2a\u63a5\u53e3\u54cd\u5e94\u5934\u4e2d\u7684<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">content-type<\/code>\uff1b\u5982\u6211\u4eec\u73b0\u5728\u6709\u4e24\u4e2a\u63a5\u53e3\uff0c\u4e00\u4e2a\u6307\u5b9a\u8fd4\u56de json \u683c\u5f0f\u6570\u636e\uff0c\u4e00\u4e2a\u6307\u5b9a\u8fd4\u56de xml \u683c\u5f0f\u6570\u636e\uff0c\u53ef\u4ee5\u5982\u4e0b\u5199<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@RestController<\/span><br  \/><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">IndexRest<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Data<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">static<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">ResVo<\/span>&lt;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">T<\/span>&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">int<\/span>&nbsp;code;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;String&nbsp;msg;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">private<\/span>&nbsp;T&nbsp;data;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">ResVo<\/span><span style=\"line-height: 26px;\">(<span style=\"color: #333;font-weight: bold;line-height: 26px;\">int<\/span>&nbsp;code,&nbsp;String&nbsp;msg,&nbsp;T&nbsp;data)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">this<\/span>.code&nbsp;=&nbsp;code;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">this<\/span>.msg&nbsp;=&nbsp;msg;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">this<\/span>.data&nbsp;=&nbsp;data;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@GetMapping<\/span>(path&nbsp;=&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"\/xml\"<\/span>,&nbsp;produces&nbsp;=&nbsp;{MediaType.APPLICATION_XML_VALUE})<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;ResVo&lt;String&gt;&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">xml<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;ResVo&lt;&gt;(<span style=\"color: #008080;line-height: 26px;\">0<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"ok\"<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"\u8fd4\u56dexml\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@GetMapping<\/span>(path&nbsp;=&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"\/json\"<\/span>,&nbsp;produces&nbsp;=&nbsp;{MediaType.APPLICATION_JSON_VALUE})<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;ResVo&lt;String&gt;&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">json<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;ResVo&lt;&gt;(<span style=\"color: #008080;line-height: 26px;\">0<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"ok\"<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"\u8fd4\u56dejson\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4e0a\u9762\u7684\u5b9e\u73b0\u4e2d<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">xml \u63a5\u53e3\uff0c\u6307\u5b9a<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">produces = application\/xml<\/code><\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">json \u63a5\u53e3\uff0c\u6307\u5b9a<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">produces = applicatin\/json<\/code><\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u63a5\u4e0b\u6765\u6211\u4eec\u8bbf\u95ee\u4e00\u4e0b\u770b\u770b\u8fd4\u56de\u7684\u662f\u5426\u548c\u9884\u671f\u4e00\u81f4<\/p>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1.0133185349611542\"  data-type=\"jpeg\" data-w=\"901\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040603754.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0133185349611542\"  data-type=\"jpeg\" data-w=\"901\" style=\"display: block;margin: 0px auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040603754.jpeg\"  \/><\/noscript><\/figure>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4ece\u4e0a\u9762\u622a\u56fe\u4e5f\u53ef\u4ee5\u770b\u51fa\uff0cxml \u63a5\u53e3\u8fd4\u56de\u7684\u662f xml \u683c\u5f0f\u6570\u636e\uff1bjson \u63a5\u53e3\u8fd4\u56de\u7684\u662f json \u683c\u5f0f\u6570\u636e<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">2. \u901a\u8fc7\u8bf7\u6c42\u5934 accept \u8bbe\u7f6e\u8fd4\u56de\u7c7b\u578b<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4e0a\u9762\u7684\u65b9\u5f0f\uff0c\u975e\u5e38\u76f4\u89c2\uff0c\u81ea\u7136\u6211\u4eec\u5c31\u4f1a\u6709\u4e00\u4e2a\u7591\u95ee\uff0c\u5f53\u63a5\u53e3\u4e0a\u4e0d\u6307\u5b9a produces \u5c5e\u6027\u65f6\uff0c\u76f4\u63a5\u8bbf\u95ee\u4f1a\u600e\u4e48\u8868\u73b0\u5462\uff1f<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@GetMapping<\/span>(path&nbsp;=&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"\/\"<\/span>)<br  \/><span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;ResVo&lt;String&gt;&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">index<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;ResVo&lt;&gt;(<span style=\"color: #008080;line-height: 26px;\">0<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"ok\"<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"\u7b80\u5355\u7684\u6d4b\u8bd5\"<\/span>);<br  \/>}<br  \/><\/code><\/pre>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\"  data-type=\"jpeg\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-ratio=\"0.5296296296296297\" data-w=\"1080\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040605935.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\"  data-type=\"jpeg\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-ratio=\"0.5296296296296297\" data-w=\"1080\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040605935.jpeg\"  \/><\/noscript><\/figure>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u8bf7\u6ce8\u610f\u4e0a\u9762\u7684\u622a\u56fe\uff0c\u4e24\u79cd\u8bbf\u95ee\u65b9\u5f0f\u8fd4\u56de\u7684\u6570\u636e\u7c7b\u578b\u4e0d\u4e00\u81f4<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">curl \u8bf7\u6c42\uff1a\u8fd4\u56de json \u683c\u5f0f\u6570\u636e<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u6d4f\u89c8\u5668\u8bf7\u6c42\uff1a\u8fd4\u56de <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">application\/xhtml+xml<\/code>\u54cd\u5e94\u5934\u7684\u6570\u636e\uff08\u5b9e\u9645\u4e0a\u8fd8\u662f xml \u683c\u5f0f\uff09<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u90a3\u4e48\u95ee\u9898\u6765\u4e86\uff0c\u4e3a\u4ec0\u4e48\u4e24\u8005\u7684\u8868\u73b0\u5f62\u5f0f\u4e0d\u4e00\u81f4\u5462\uff1f<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5bf9\u7740\u4e0a\u9762\u7684\u56fe\u518d\u770b\u4e09\u79d2\uff0c\u4f1a\u53d1\u73b0\u4e3b\u8981\u7684\u5dee\u522b\u70b9\u5c31\u5728\u4e8e\u8bf7\u6c42\u5934<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">Accept<\/code>\u4e0d\u540c\uff1b\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u8bf7\u6c42\u5934\u53c2\u6570\uff0c\u6765\u8981\u6c42\u670d\u52a1\u7aef\u8fd4\u56de\u6211\u5e0c\u671b\u7684\u6570\u636e\u7c7b\u578b<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5982\u6307\u5b9a\u8fd4\u56de json \u683c\u5f0f\u6570\u636e<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\">curl&nbsp;<span style=\"color: #d14;line-height: 26px;\">'http:\/\/127.0.0.1:8080'<\/span>&nbsp;-H&nbsp;<span style=\"color: #d14;line-height: 26px;\">'Accept:application\/xml'<\/span>&nbsp;-iv<br  \/><br  \/>curl&nbsp;<span style=\"color: #d14;line-height: 26px;\">'http:\/\/127.0.0.1:8080'<\/span>&nbsp;-H&nbsp;<span style=\"color: #d14;line-height: 26px;\">'Accept:application\/json'<\/span>&nbsp;-iv<br  \/><\/code><\/pre>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.2564814814814815\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040607648.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.2564814814814815\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040607648.jpeg\"  \/><\/noscript><\/figure>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4ece\u4e0a\u9762\u7684\u6267\u884c\u7ed3\u679c\u4e5f\u53ef\u4ee5\u770b\u51fa\uff0c\u8fd4\u56de\u7684\u7c7b\u578b\u4e0e\u9884\u671f\u7684\u4e00\u81f4\uff1b<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><strong style=\"font-weight: bold;color: black;\">\u8bf4\u660e<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u8bf7\u6c42\u5934\u53ef\u4ee5\u8bbe\u7f6e\u591a\u79cd MediaType\uff0c\u7528\u82f1\u6587\u9017\u53f7\u5206\u5272\uff0c\u540e\u7aef\u63a5\u53e3\u4f1a\u6839\u636e\u81ea\u5df1\u5b9a\u4e49\u7684 produce \u4e0e\u8bf7\u6c42\u5934\u5e0c\u671b\u7684 mediaType \u53d6\u4ea4\u96c6\uff0c\u81f3\u4e8e\u6700\u7ec8\u9009\u62e9\u7684\u987a\u5e8f\u5219\u4ee5 accept \u4e2d\u51fa\u73b0\u7684\u987a\u5e8f\u4e3a\u51c6<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u770b\u4e00\u4e0b\u5b9e\u9645\u7684\u8868\u73b0\u6765\u9a8c\u8bc1\u4e0b\u4e0a\u9762\u7684\u8bf4\u6cd5<\/p>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.2935185185185185\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040608772.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.2935185185185185\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040608772.jpeg\"  \/><\/noscript><\/figure>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u901a\u8fc7\u8bf7\u6c42\u5934\u6765\u63a7\u5236\u8fd4\u56de\u6570\u636e\u7c7b\u578b\u7684\u65b9\u5f0f\u53ef\u4ee5\u8bf4\u662f\u975e\u5e38\u7ecf\u5178\u7684\u7b56\u7565\u4e86\uff0c\uff08\u9075\u5faa html \u534f\u8bae\u8fd8\u6709\u4ec0\u4e48\u597d\u8bf4\u7684\u5462\uff01\uff09<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">3. \u8bf7\u6c42\u53c2\u6570\u6765\u63a7\u5236\u8fd4\u56de\u7c7b\u578b<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u9664\u4e86\u4e0a\u9762\u4ecb\u7ecd\u7684\u4e24\u79cd\u65b9\u5f0f\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u8003\u8651\u4e3a\u6240\u6709\u7684\u63a5\u53e3\uff0c\u589e\u52a0\u4e00\u4e2a\u6839\u636e\u7279\u5b9a\u7684\u8bf7\u6c42\u53c2\u6570\u6765\u63a7\u5236\u8fd4\u56de\u7684\u7c7b\u578b\u7684\u65b9\u5f0f<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6bd4\u5982\u6211\u4eec\u73b0\u5728\u5b9a\u4e49\uff0c\u6240\u6709\u7684\u63a5\u53e3\u53ef\u4ee5\u9009\u4f20\u4e00\u4e2a\u53c2\u6570 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaType<\/code>\uff0c\u5982\u679c\u503c\u4e3a xml\uff0c\u5219\u8fd4\u56de xml \u683c\u5f0f\u6570\u636e\uff1b\u5982\u679c\u503c\u4e3a json\uff0c\u5219\u8fd4\u56de json \u683c\u5f0f\u6570\u636e<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5f53\u4e0d\u4f20\u65f6\uff0c\u9ed8\u8ba4\u8fd4\u56de json \u683c\u5f0f\u6570\u636e<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u57fa\u4e8e\u6b64\uff0c\u6211\u4eec\u4e3b\u8981\u501f\u52a9 mvc \u914d\u7f6e\u4e2d\u7684\u5185\u5bb9\u534f\u5546<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">ContentNegotiationConfigurer<\/code>\u6765\u5b9e\u73b0<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@SpringBootApplication<\/span><br  \/><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">Application<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: #458;font-weight: bold;line-height: 26px;\">WebMvcConfigurer<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #999;font-weight: bold;line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">configureContentNegotiation<\/span><span style=\"line-height: 26px;\">(ContentNegotiationConfigurer&nbsp;configurer)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;configurer.favorParameter(<span style=\"color: #333;font-weight: bold;line-height: 26px;\">true<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7981\u7528accept\u534f\u5546\u65b9\u5f0f\uff0c\u5373\u4e0d\u5173\u5fc3\u524d\u7aef\u4f20\u7684accept\u503c<\/span><br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.ignoreAcceptHeader(true)<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u54ea\u4e2a\u653e\u5728\u524d\u9762\uff0c\u54ea\u4e2a\u7684\u4f18\u5148\u7ea7\u5c31\u9ad8\uff1b&nbsp;\u5f53\u4e0a\u9762\u8fd9\u4e2aaccept\u672a\u7981\u7528\u65f6\uff0c\u82e5\u8bf7\u6c42\u4f20\u7684accept\u4e0d\u80fd\u8986\u76d6\u4e0b\u9762\u4e24\u79cd\uff0c\u5219\u4f1a\u51fa\u73b0406\u9519\u8bef<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.defaultContentType(MediaType.APPLICATION_JSON,&nbsp;MediaType.APPLICATION_XML)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6839\u636e\u4f20\u53c2mediaType\u6765\u51b3\u5b9a\u8fd4\u56de\u6837\u5f0f<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.parameterName(<span style=\"color: #d14;line-height: 26px;\">\"mediaType\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5f53acceptHeader\u672a\u7981\u7528\u65f6\uff0caccept\u7684\u503c\u4e0emediaType\u4f20\u53c2\u7684\u503c\u4e0d\u4e00\u81f4\u65f6\uff0c\u4ee5mediaType\u7684\u4f20\u503c\u4e3a\u51c6<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;mediaType\u503c\u53ef\u4ee5\u4e0d\u4f20\uff0c\u4e3a\u7a7a\u4e5f\u884c\uff0c\u4f46\u662f\u4e0d\u80fd\u662fjson\/xml\u4e4b\u5916\u7684\u5176\u4ed6\u503c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.mediaType(<span style=\"color: #d14;line-height: 26px;\">\"json\"<\/span>,&nbsp;MediaType.APPLICATION_JSON)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.mediaType(<span style=\"color: #d14;line-height: 26px;\">\"xml\"<\/span>,&nbsp;MediaType.APPLICATION_XML);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SpringApplication.run(Application<span style=\"line-height: 26px;\">.<span style=\"color: #333;font-weight: bold;line-height: 26px;\">class<\/span>)<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4e0a\u9762\u7684\u5b9e\u73b0\u4e2d\uff0c\u6dfb\u52a0\u4e86\u5f88\u591a\u6ce8\u91ca\uff0c\u5148\u522b\u6025\uff1b\u6211\u6765\u9010\u4e00\u8fdb\u884c\u8bf4\u660e<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\">.parameterName(<span style=\"color: #d14;line-height: 26px;\">\"mediaType\"<\/span>)<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5f53acceptHeader\u672a\u7981\u7528\u65f6\uff0caccept\u7684\u503c\u4e0emediaType\u4f20\u53c2\u7684\u503c\u4e0d\u4e00\u81f4\u65f6\uff0c\u4ee5mediaType\u7684\u4f20\u503c\u4e3a\u51c6<\/span><br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;mediaType\u503c\u53ef\u4ee5\u4e0d\u4f20\uff0c\u4e3a\u7a7a\u4e5f\u884c\uff0c\u4f46\u662f\u4e0d\u80fd\u662fjson\/xml\u4e4b\u5916\u7684\u5176\u4ed6\u503c<\/span><br  \/>.mediaType(<span style=\"color: #d14;line-height: 26px;\">\"json\"<\/span>,&nbsp;MediaType.APPLICATION_JSON)<br  \/>.mediaType(<span style=\"color: #d14;line-height: 26px;\">\"xml\"<\/span>,&nbsp;MediaType.APPLICATION_XML);<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4e0a\u9762\u8fd9\u4e09\u884c\u4ee3\u7801\uff0c\u4e3b\u8981\u5c31\u662f\u8bf4\uff0c\u73b0\u5728\u53ef\u4ee5\u6839\u636e\u4f20\u53c2 mediaType \u6765\u63a7\u5236\u8fd4\u56de\u7684\u7c7b\u578b\uff0c\u6211\u4eec\u65b0\u589e\u4e00\u4e2a\u63a5\u53e3\u6765\u9a8c\u8bc1\u4e00\u4e0b<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #999;font-weight: bold;line-height: 26px;\">@GetMapping<\/span>(path&nbsp;=&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"param\"<\/span>)<br  \/><span style=\"line-height: 26px;\"><span style=\"color: #333;font-weight: bold;line-height: 26px;\">public<\/span>&nbsp;ResVo&lt;String&gt;&nbsp;<span style=\"color: #900;font-weight: bold;line-height: 26px;\">params<\/span><span style=\"line-height: 26px;\">(@RequestParam(name&nbsp;=&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"mediaType\"<\/span>,&nbsp;required&nbsp;=&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">false<\/span>)<\/span>&nbsp;String&nbsp;mediaType)&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #333;font-weight: bold;line-height: 26px;\">new<\/span>&nbsp;ResVo&lt;&gt;(<span style=\"color: #008080;line-height: 26px;\">0<\/span>,&nbsp;<span style=\"color: #d14;line-height: 26px;\">\"ok\"<\/span>,&nbsp;String.format(<span style=\"color: #d14;line-height: 26px;\">\"\u57fa\u4e8e\u4f20\u53c2\u6765\u51b3\u5b9a\u8fd4\u56de\u7c7b\u578b\uff1a%s\"<\/span>,&nbsp;mediaType));<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6211\u4eec\u6765\u770b\u4e0b\u51e0\u4e2a\u4e0d\u540c\u7684\u4f20\u53c2\u8868\u73b0<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\"><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;\u8fd4\u56dejson\u683c\u5f0f\u6570\u636e<\/span><br  \/>curl&nbsp;<span style=\"color: #d14;line-height: 26px;\">'http:\/\/127.0.0.1:8080\/param?mediaType=json'<\/span>&nbsp;-iv<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;\u8fd4\u56dexml\u683c\u5f0f\u6570\u636e<\/span><br  \/>curl&nbsp;<span style=\"color: #d14;line-height: 26px;\">'http:\/\/127.0.0.1:8080\/param?mediaType=xml'<\/span>&nbsp;-iv<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;406\u9519\u8bef<\/span><br  \/>curl&nbsp;<span style=\"color: #d14;line-height: 26px;\">'http:\/\/127.0.0.1:8080\/param?mediaType=text'<\/span>&nbsp;-iv<br  \/><span style=\"color: #998;font-style: italic;line-height: 26px;\">#&nbsp;\u8d70\u9ed8\u8ba4\u7684\u8fd4\u56de\u7c7b\u578b\uff0cjson\u5728\u524d\uff0c\u6240\u4ee5\u8fd4\u56dejson\u683c\u5f0f\u6570\u636e\uff08\u5982\u679c\u5c06xml\u8c03\u6574\u5230\u524d\u9762\uff0c\u5219\u8fd4\u56dexml\u683c\u5f0f\u6570\u636e\uff0c\u4e3b\u8981\u53d6\u51b3\u4e8e&nbsp;`.defaultContentType(MediaType.APPLICATION_JSON,&nbsp;MediaType.APPLICATION_XML)`\uff09<\/span><br  \/>curl&nbsp;<span style=\"color: #d14;line-height: 26px;\">'http:\/\/127.0.0.1:8080\/param'<\/span>&nbsp;-iv<br  \/><\/code><\/pre>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.49166666666666664\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040610281.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.49166666666666664\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040610281.jpeg\"  \/><\/noscript><\/figure>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><strong style=\"font-weight: bold;color: black;\">\u7591\u95ee\uff1a\u82e5\u8bf7\u6c42\u5934\u4e2d\u4f20\u9012\u4e86 Accept \u6216\u8005\u63a5\u53e3\u4e0a\u5b9a\u4e49\u4e86 produce\uff0c\u4f1a\u600e\u6837?<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5f53\u6307\u5b9a\u4e86 accept \u65f6\uff0c\u5e76\u4e14\u4f20\u53c2\u4e2d\u6307\u5b9a\u4e86 mediaType\uff0c\u5219\u4ee5\u4f20\u53c2\u4e3a\u51c6<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5982<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">accept: application\/json,application.xml<\/code>\uff0c \u6b64\u65f6<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaType=json<\/code>, \u8fd4\u56de json \u683c\u5f0f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5982<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">accept: application\/json<\/code>, \u6b64\u65f6 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaTyep=xml<\/code>\uff0c \u8fd4\u56de xml \u683c\u5f0f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5982<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">accept: text\/html<\/code>\uff0c\u6b64\u65f6<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaType=xml<\/code> \uff0c\u6b64\u65f6\u8fd4\u56de\u7684\u4e5f\u662f xml \u683c\u5f0f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5982<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">accept: text\/html<\/code>\uff0c\u6b64\u65f6<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaType<\/code>\u4e0d\u4f20\u65f6 \uff0c\u56e0\u4e3a\u65e0\u6cd5\u5904\u7406<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">text\/html<\/code>\u7c7b\u578b\uff0c\u6240\u4ee5\u4f1a\u51fa\u73b0 406<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5982<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">accept: application\/xml<\/code>\uff0c \u4f46\u662f<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaType<\/code>\u4e0d\u4f20\uff0c\u867d\u7136\u9ed8\u8ba4\u4f18\u5148\u662f json\uff0c\u6b64\u65f6\u8fd4\u56de\u7684\u4e5f\u662f xml \u683c\u5f0f\uff0c\u4e0e\u8bf7\u6c42\u5934\u5e0c\u671b\u7684\u4fdd\u6301\u4e00\u81f4<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4f46\u662f\u82e5\u4f20\u53c2\u4e0e produce \u51b2\u7a81\u4e86\uff0c\u90a3\u4e48\u5c31\u76f4\u63a5 406 \u5f02\u5e38\uff0c\u4e0d\u4f1a\u9009\u62e9 mediaType \u8bbe\u7f6e\u7684\u7c7b\u578b<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5982<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">produce = applicatin\/json<\/code>\uff0c \u4f46\u662f <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">mediaType=xml<\/code>\uff0c\u6b64\u65f6\u5c31\u4f1a\u559c\u63d0 406<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u7ec6\u5fc3\u7684\u5c0f\u4f19\u4f34\u53ef\u80fd\u53d1\u73b0\u4e86\u4e0a\u9762\u7684\u914d\u7f6e\u4e2d\uff0c\u6ce8\u91ca\u4e86\u4e00\u884c <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">.ignoreAcceptHeader(true)<\/code>\uff0c\u5f53\u6211\u4eec\u628a\u5b83\u6253\u5f00\u4e4b\u540e\uff0c\u524d\u9762\u8bf4\u7684 Accept \u8bf7\u6c42\u5934\u53ef\u4ee5\u968f\u610f\u4f20\uff0c\u6211\u4eec\u5b8c\u5168\u4e0d care\uff0c\u5f53\u505a\u6ca1\u6709\u4f20\u8fd9\u4e2a\u53c2\u6570\u8fdb\u884c\u5904\u7406\u5373\u53ef\u5f00<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">4.\u5c0f\u7ed3<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u672c\u6587\u4ecb\u7ecd\u4e86\u4e09\u79cd\u65b9\u5f0f\uff0c\u63a7\u5236\u63a5\u53e3\u8fd4\u56de\u6570\u636e\u7c7b\u578b<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><strong style=\"font-weight: bold;color: black;\">\u65b9\u5f0f\u4e00<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u63a5\u53e3\u4e0a\u5b9a\u4e49 produce, \u5982 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">@GetMapping(path = \"p2\", produces = {\"application\/xml\", \"application\/json\"})<\/code><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6ce8\u610f produces \u5c5e\u6027\u503c\u662f\u6709\u5e8f\u7684\uff0c\u5373\u5148\u5b9a\u4e49\u7684\u4f18\u5148\u7ea7\u66f4\u9ad8\uff1b\u5f53\u4e00\u4e2a\u8bf7\u6c42\u53ef\u4ee5\u540c\u65f6\u63a5\u53d7 xml\/json \u683c\u5f0f\u6570\u636e\u65f6\uff0c\u4e0a\u9762\u8fd9\u4e2a\u5b9a\u4e49\u4f1a\u786e\u4fdd\u8fd9\u4e2a\u63a5\u53e3\u73b0\u6709\u8fd4\u56de xml \u683c\u5f0f\u6570\u636e<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><strong style=\"font-weight: bold;color: black;\">\u65b9\u5f0f\u4e8c<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u501f\u52a9\u6807\u51c6\u7684\u8bf7\u6c42\u5934 accept\uff0c\u63a7\u5236\u5e0c\u671b\u8fd4\u56de\u7684\u6570\u636e\u7c7b\u578b\uff1b\u4f46\u662f\u9700\u8981\u6ce8\u610f\u7684\u65f6\uff0c\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u65f6\uff0c\u8981\u6c42\u540e\u7aef\u4e0d\u80fd\u8bbe\u7f6e<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">ContentNegotiationConfigurer.ignoreAcceptHeader(true)<\/code><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5728\u5b9e\u9645\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u7684\u65f6\u5019\uff0c\u5ba2\u6237\u7aef\u9700\u8981\u989d\u5916\u6ce8\u610f\uff0cAccept \u8bf7\u6c42\u5934\u4e2d\u5b9a\u4e49\u7684 MediaType \u7684\u987a\u5e8f\uff0c\u662f\u4f18\u4e8e\u540e\u7aef\u5b9a\u4e49\u7684 produces \u987a\u5e8f\u7684\uff0c\u56e0\u6b64\u7528\u6237\u9700\u8981\u5c06\u81ea\u5df1\u5b9e\u9645\u5e0c\u671b\u63a5\u53d7\u7684\u6570\u636e\u7c7b\u578b\u653e\u5728\u524d\u9762\uff0c\u6216\u8005\u5e72\u8106\u5c31\u53ea\u8bbe\u7f6e\u4e00\u4e2a<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\"><strong style=\"font-weight: bold;color: black;\">\u65b9\u5f0f\u4e09<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u501f\u52a9<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">ContentNegotiationConfigurer<\/code>\u5b9e\u73b0\u901a\u8fc7\u8bf7\u6c42\u53c2\u6570\u6765\u51b3\u5b9a\u8fd4\u56de\u7c7b\u578b\uff0c\u5e38\u89c1\u7684\u914d\u7f6e\u65b9\u5f0f\u5f62\u5982<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;\"><code style=\"overflow-x: auto;padding: 16px;color: #333;background: #f8f8f8;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;border-radius: 0px;font-size: 12px;-webkit-overflow-scrolling: touch;\">configurer.favorParameter(<span style=\"color: #333;font-weight: bold;line-height: 26px;\">true<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7981\u7528accept\u534f\u5546\u65b9\u5f0f\uff0c\u5373\u4e0d\u5173\u5fc3\u524d\u7aef\u4f20\u7684accept\u503c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.ignoreAcceptHeader(true)<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u54ea\u4e2a\u653e\u5728\u524d\u9762\uff0c\u54ea\u4e2a\u7684\u4f18\u5148\u7ea7\u5c31\u9ad8\uff1b&nbsp;\u5f53\u4e0a\u9762\u8fd9\u4e2aaccept\u672a\u7981\u7528\u65f6\uff0c\u82e5\u8bf7\u6c42\u4f20\u7684accept\u4e0d\u80fd\u8986\u76d6\u4e0b\u9762\u4e24\u79cd\uff0c\u5219\u4f1a\u51fa\u73b0406\u9519\u8bef<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.defaultContentType(MediaType.APPLICATION_JSON,&nbsp;MediaType.APPLICATION_XML)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6839\u636e\u4f20\u53c2mediaType\u6765\u51b3\u5b9a\u8fd4\u56de\u6837\u5f0f<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.parameterName(<span style=\"color: #d14;line-height: 26px;\">\"mediaType\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5f53acceptHeader\u672a\u7981\u7528\u65f6\uff0caccept\u7684\u503c\u4e0emediaType\u4f20\u53c2\u7684\u503c\u4e0d\u4e00\u81f4\u65f6\uff0c\u4ee5mediaType\u7684\u4f20\u503c\u4e3a\u51c6<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #998;font-style: italic;line-height: 26px;\">\/\/&nbsp;mediaType\u503c\u53ef\u4ee5\u4e0d\u4f20\uff0c\u4e3a\u7a7a\u4e5f\u884c\uff0c\u4f46\u662f\u4e0d\u80fd\u662fjson\/xml\u4e4b\u5916\u7684\u5176\u4ed6\u503c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.mediaType(<span style=\"color: #d14;line-height: 26px;\">\"json\"<\/span>,&nbsp;MediaType.APPLICATION_JSON)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.mediaType(<span style=\"color: #d14;line-height: 26px;\">\"xml\"<\/span>,&nbsp;MediaType.APPLICATION_XML);<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5373\u6dfb\u52a0\u8fd9\u4e2a\u8bbe\u7f6e\u4e4b\u540e\uff0c\u6700\u7ec8\u7684\u8868\u73b0\u4e3a\uff1a<\/p>\n<ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: decimal;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u8bf7\u6c42\u53c2\u6570\u6307\u5b9a\u7684\u8fd4\u56de\u7c7b\u578b\uff0c\u4f18\u5148\u7ea7\u6700\u9ad8\uff0c\u8fd4\u56de\u6307\u5b9a\u53c2\u6570\u5bf9\u5e94\u7684\u7c7b\u578b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u6ca1\u6709\u6307\u5b9a\u53c2\u6570\u65f6\uff0c\u9009\u62e9 defaultContentType \u5b9a\u4e49\u7684\u9ed8\u8ba4\u8fd4\u56de\u7c7b\u578b\u4e0e\u63a5\u53e3 <code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">produce<\/code>\u4e2d\u652f\u6301\u7684\u6c42\u4ea4\u96c6\uff0c\u4f18\u5148\u7ea7\u5219\u6309\u7167 defaultContentType \u4e2d\u5b9a\u4e49\u7684\u987a\u5e8f\u6765\u9009\u62e9<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u6ca1\u6709\u6307\u5b9a\u53c2\u6570\u65f6\uff0c\u82e5\u6b64\u65f6\u8fd8\u6709 accept \u8bf7\u6c42\u5934\uff0c\u5219\u8bf7\u6c42\u5934\u4e2d\u5b9a\u4e49\u987a\u5e8f\u7684\u4f18\u5148\u7ea7\u9ad8\u4e8e defaultContentType\uff0c \u9ad8\u4e8e produce<\/section>\n<\/li>\n<\/ol>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6ce8\u610f\u6ce8\u610f\uff1a\u5f53\u914d\u7f6e\u4e2d\u5ffd\u7565\u4e86 AcceptHeader \u65f6\uff0c<code style=\"font-size: 14px;word-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin: 0 2px;background-color: rgba(27,31,35,.05);font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(239, 112, 96);\">.ignoreAcceptHeader(true)<\/code>\uff0c\u4e0a\u9762\u7b2c\u4e09\u6761\u4f5c\u5e9f<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u6700\u540e\u7684\u6700\u540e\uff0c\u672c\u6587\u6240\u6709\u7684\u6e90\u7801\u53ef\u4ee5\u518d\u4e0b\u9762\u7684 git \u4e2d\u83b7\u53d6\uff1b\u672c\u6587\u7684\u77e5\u8bc6\u70b9\u5df2\u7ecf\u6c47\u603b\u5728\u300a\u4e00\u7070\u7070\u7684 Spring \u4e13\u680f\u300b \u4e24\u767e\u591a\u7bc7\u7684\u539f\u521b\u7cfb\u5217\u535a\u6587\uff0c\u4f60\u503c\u5f97\u62e5\u6709\uff1b\u6211\u662f\u4e00\u7070\u7070\uff0c\u54b1\u4eec\u4e0b\u6b21\u518d\u89c1<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;border-bottom: 2px solid rgb(239, 112, 96);font-size: 1.3em;text-align: center;\"><span style=\"display: none;\"><\/span><span style=\"display: inline-block;font-weight: bold;color: #000000;padding: 3px 10px 1px;border-top-right-radius: 3px;border-top-left-radius: 3px;margin-right: 3px;\">III. \u4e0d\u80fd\u9519\u8fc7\u7684\u6e90\u7801\u548c\u76f8\u5173\u77e5\u8bc6\u70b9<\/span><span style=\"display: inline-block;vertical-align: bottom;border-bottom: 36px solid #efebe9;border-right: 20px solid transparent;\"> <\/span><\/h2>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">0. \u9879\u76ee<\/span><span style=\"display: none;\"><\/span><\/h3>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u5de5\u7a0b\uff1ahttps:\/\/github.com\/liuyueyi\/spring-boot-demo<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u6e90\u7801\uff1ahttps:\/\/github.com\/liuyueyi\/spring-boot-demo\/tree\/master\/spring-boot\/204-web-xml-json<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;\"><span style=\"display: none;\"><\/span><span style=\"border-left: 4px solid rgb(248,57,41);padding-left: 8px;\">1. \u5fae\u4fe1\u516c\u4f17\u53f7: \u4e00\u7070\u7070 Blog<\/span><span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u5c3d\u4fe1\u4e66\u5219\u4e0d\u5982\uff0c\u4ee5\u4e0a\u5185\u5bb9\uff0c\u7eaf\u5c5e\u4e00\u5bb6\u4e4b\u8a00\uff0c\u56e0\u4e2a\u4eba\u80fd\u529b\u6709\u9650\uff0c\u96be\u514d\u6709\u758f\u6f0f\u548c\u9519\u8bef\u4e4b\u5904\uff0c\u5982\u53d1\u73b0 bug \u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\uff0c\u6b22\u8fce\u6279\u8bc4\u6307\u6b63\uff0c\u4e0d\u541d\u611f\u6fc0<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0;line-height: 26px;color: black;\">\u4e0b\u9762\u4e00\u7070\u7070\u7684\u4e2a\u4eba\u535a\u5ba2\uff0c\u8bb0\u5f55\u6240\u6709\u5b66\u4e60\u548c\u5de5\u4f5c\u4e2d\u7684\u535a\u6587\uff0c\u6b22\u8fce\u5927\u5bb6\u524d\u53bb\u901b\u901b<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;list-style-type: disc;\" class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u4e00\u7070\u7070 Blog \u4e2a\u4eba\u535a\u5ba2 https:\/\/blog.hhui.top<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;text-align: left;color: rgb(1,1,1);font-weight: 500;\">\u4e00\u7070\u7070 Blog-Spring \u4e13\u9898\u535a\u5ba2 http:\/\/spring.hhui.top<\/section>\n<\/li>\n<\/ul>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin: 0;margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.42685185185185187\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040611364.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.42685185185185187\"  data-type=\"jpeg\" data-w=\"1080\" style=\"display: block;margin: 0px auto;max-width: 100%;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040611364.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: #888;font-size: 14px;\">\u4e00\u7070\u7070blog<\/figcaption><\/figure>\n<\/section>\n<p><br  \/><\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u4e00\u7070\u7070blog              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>SpringBoot \u7cfb\u5217\u6559\u7a0b\u4e4b\u5b9a\u4e49\u63a5\u53e3\u8fd4\u56de\u7c7b\u578b\u7684\u51e0\u79cd\u65b9\u5f0f \u5b9e\u73b0\u4e00\u4e2a web \u63a5\u53e3\u8fd4\u56de json \u6570\u636e\uff0c\u57fa\u672c\u4e0a\u662f\u6bcf\u4e00\u4e2a javae &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1223,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7,19],"tags":[],"class_list":["post-1231","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot","category-19"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040600285-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040602718.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040600285-300x127.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040600285.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040602718.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040600285-300x127.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040600285.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040600285.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040602718.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040602718.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040603754.jpeg","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040603754.jpeg","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040605935.jpeg","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040605935.jpeg","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040607648.jpeg","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040607648.jpeg","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040608772.jpeg","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040608772.jpeg","id":"image9"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040610281.jpeg","id":"image10"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040610281.jpeg","id":"image11"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040611364.jpeg","id":"image12"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528040611364.jpeg","id":"image13"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2023-05-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":231,"next_post_id":1695,"next_post_title":"Spring Boot \u6211\u968f\u624b\u5c01\u88c5\u4e86\u4e00\u4e2a\u4e07\u80fd\u7684 Excel \u5bfc\u51fa\u5de5\u5177\uff0c\u4f20\u4ec0\u4e48\u90fd\u80fd\u5bfc\u51fa\uff01","previous_post_id":1102,"previous_post_title":"\u5728Java\u4e2d\u53d1\u9001kafka\u6d88\u606f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1231"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1231\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1223"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}