{"id":5833,"date":"2024-08-01T22:46:23","date_gmt":"2024-08-01T14:46:23","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=5833"},"modified":"2024-08-02T16:22:33","modified_gmt":"2024-08-02T08:22:33","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8spring%e4%b8%ad%e9%80%9a%e8%bf%87%e8%87%aa%e5%ae%9a%e4%b9%89%e6%b3%a8%e8%a7%a3enumvalue%e6%a0%a1%e9%aa%8c%e6%9e%9a%e4%b8%be%e5%80%bc","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/%e5%a6%82%e4%bd%95%e5%9c%a8spring%e4%b8%ad%e9%80%9a%e8%bf%87%e8%87%aa%e5%ae%9a%e4%b9%89%e6%b3%a8%e8%a7%a3enumvalue%e6%a0%a1%e9%aa%8c%e6%9e%9a%e4%b8%be%e5%80%bc\/","title":{"rendered":"\u5982\u4f55\u5728Spring\u4e2d\u901a\u8fc7\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue\u6821\u9a8c\u679a\u4e3e\u503c"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"margin-bottom: 8px;\"><em>\u70b9\u51fb\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u66f4\u591a<strong>\u8d44\u8baf<\/strong>\u53ca\u65f6\u63a8\u9001\u2193<\/em><\/section>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<section style=\"margin-bottom: 0px;\"><span style=\"font-size: 16px;\">\u5728Spring\u6846\u67b6\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u5bf9\u8bf7\u6c42\u53c2\u6570\u8fdb\u884c\u6821\u9a8c\uff0c\u5c24\u5176\u662f\u5bf9\u679a\u4e3e\u503c\u7684\u6821\u9a8c\u3002\u4e3a\u4e86\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u81ea\u5b9a\u4e49\u6ce8\u89e3\u6765\u5b9e\u73b0\u5bf9\u679a\u4e3e\u503c\u7684\u6821\u9a8c\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Spring\u4e2d\u521b\u5efa\u548c\u4f7f\u7528\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue\u6765\u4f18\u96c5\u5730\u6821\u9a8c\u679a\u4e3e\u503c\u3002<\/span><\/section>\n<h4 style=\"margin-top: 16px; margin-bottom: 8px;\"><strong><span style=\"font-size: 18px;\">1. \u5f15\u8a00<\/span><\/strong><\/h4>\n<section style=\"margin-bottom: 0px;\"><span style=\"font-size: 16px;\">\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u786e\u4fdd\u8f93\u5165\u7684\u53c2\u6570\u503c\u5728\u9884\u5b9a\u4e49\u7684\u679a\u4e3e\u503c\u8303\u56f4\u5185\u3002\u4f20\u7edf\u7684\u505a\u6cd5\u662f\u624b\u52a8\u7f16\u5199\u6821\u9a8c\u903b\u8f91\uff0c\u8fd9\u4e0d\u4ec5\u7e41\u7410\uff0c\u800c\u4e14\u5bb9\u6613\u51fa\u9519\u3002\u901a\u8fc7\u81ea\u5b9a\u4e49\u6ce8\u89e3\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u6821\u9a8c\u903b\u8f91\u62bd\u8c61\u51fa\u6765\uff0c\u4f7f\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u548c\u6613\u8bfb\u3002<\/span><\/section>\n<h4 style=\"margin-top: 16px; margin-bottom: 8px;\"><strong><span style=\"font-size: 18px;\">2. \u4ec0\u4e48\u662f\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue<\/span><\/strong><\/h4>\n<section style=\"margin-bottom: 8px;\"><span style=\"font-size: 16px;\">\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue\u662f\u4e00\u79cd\u6ce8\u89e3\uff0c\u4e13\u95e8\u7528\u4e8e\u6821\u9a8c\u679a\u4e3e\u7c7b\u578b\u7684\u5b57\u6bb5\u3002\u5b83\u7ed3\u5408\u4e86Java\u7684\u6ce8\u89e3\u548cSpring\u7684\u6821\u9a8c\u673a\u5236\uff0c\u901a\u8fc7\u6307\u5b9a\u679a\u4e3e\u7c7b\uff0c\u81ea\u52a8\u68c0\u67e5\u5b57\u6bb5\u503c\u662f\u5426\u5728\u8be5\u679a\u4e3e\u7c7b\u7684\u5b9a\u4e49\u8303\u56f4\u5185\u3002\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4ec5\u7b80\u5316\u4e86\u6821\u9a8c\u903b\u8f91\uff0c\u8fd8\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/span><\/section>\n<section style=\"margin-bottom: 8px;\"><span style=\"font-size: 16px;\">\u81ea\u5b9a\u4e49\u6ce8\u89e3\u7684\u597d\u5904\u5305\u62ec\uff1a<\/span><\/section>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section style=\"margin-bottom: 8px;\"><strong>\u4ee3\u7801\u91cd\u7528<\/strong>\uff1a<span style=\"font-size: 16px;\">\u5c06\u901a\u7528\u7684\u6821\u9a8c\u903b\u8f91\u5c01\u88c5\u5728\u4e00\u4e2a\u6ce8\u89e3\u4e2d\uff0c\u53ef\u4ee5\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\u3002<\/span><\/section>\n<\/li>\n<li>\n<section style=\"margin-bottom: 8px;\"><strong>\u4ee3\u7801\u6e05\u6670<\/strong>\uff1a<span style=\"font-size: 16px;\">\u901a\u8fc7\u6ce8\u89e3\u7684\u5f62\u5f0f\uff0c\u6821\u9a8c\u903b\u8f91\u66f4\u52a0\u76f4\u89c2\u548c\u660e\u786e\u3002<\/span><\/section>\n<\/li>\n<li>\n<section style=\"margin-bottom: 0px;\"><strong>\u7ef4\u62a4\u65b9\u4fbf<\/strong>\uff1a<span style=\"font-size: 16px;\">\u5f53\u9700\u8981\u4fee\u6539\u6821\u9a8c\u903b\u8f91\u65f6\uff0c\u53ea\u9700\u4fee\u6539\u6ce8\u89e3\u6216\u6821\u9a8c\u5668\u7c7b\u5373\u53ef\uff0c\u51cf\u5c11\u4e86\u91cd\u590d\u4ee3\u7801\u7684\u7ef4\u62a4\u6210\u672c\u3002<\/span><\/section>\n<\/li>\n<\/ul>\n<h4 style=\"margin-top: 16px; margin-bottom: 8px;\"><strong><span style=\"font-size: 18px;\">3. \u521b\u5efa\u679a\u4e3e\u7c7b<\/span><\/strong><\/h4>\n<section style=\"margin-bottom: 8px;\"><span style=\"font-size: 16px;\">\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u679a\u4e3e\u7c7b\u6765\u5b9a\u4e49\u5141\u8bb8\u7684\u503c\u3002\u4f8b\u5982\uff0c\u5b9a\u4e49\u4e00\u4e2a\u8868\u793a\u989c\u8272\u7684\u679a\u4e3e\u7c7b\uff1a<\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<pre class=\"code-snippet__js\" data-lang=\"swift\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">enum<\/span> <span class=\"code-snippet__title\">Color<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__type\">RED<\/span>,<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__type\">GREEN<\/span>,<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__type\">BLUE<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><\/pre>\n<\/section>\n<h4 style=\"margin-top: 16px; margin-bottom: 8px;\"><strong><span style=\"font-size: 18px;\">4. \u521b\u5efa\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue<\/span><\/strong><\/h4>\n<section style=\"margin-bottom: 8px;\"><span style=\"font-size: 16px;\">\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue\uff0c\u7528\u4e8e\u6807\u8bc6\u9700\u8981\u6821\u9a8c\u7684\u679a\u4e3e\u7c7b\u578b\u5b57\u6bb5\u3002<\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<div>\n<pre>import javax.validation.Constraint;\nimport javax.validation.Payload;\nimport java.lang.annotation.*;\n\n@Documented\n@Constraint(validatedBy = EnumValueValidator.class)\n@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface EnumValue {\n    Class&lt;? extends Enum&lt;?&gt;&gt; enumClass();\n\n    String message() default \"Invalid value. This is not permitted.\";\n\n    Class&lt;?&gt;[] groups() default {};\n\n    Class&lt;? extends Payload&gt;[] payload() default {};\n}<\/pre>\n<\/div>\n<\/section>\n<h4><strong><span style=\"font-size: 18px;\">5.<\/span><\/strong><strong><span style=\"font-size: 18px;\">\u521b\u5efa\u6821\u9a8c\u5668EnumValueValidator<\/span><\/strong><\/h4>\n<section style=\"margin-bottom: 8px;\"><span style=\"font-size: 16px;\">\u5b9e\u73b0\u6821\u9a8c\u903b\u8f91\u7684\u6838\u5fc3\u5728\u4e8e\u521b\u5efaEnumValueValidator\u7c7b\uff0c\u8be5\u7c7b\u5b9e\u73b0ConstraintValidator\u63a5\u53e3\u3002<\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<div>\n<pre>import javax.validation.ConstraintValidator;\nimport javax.validation.ConstraintValidatorContext;\nimport java.util.Arrays;\n\npublic class EnumValueValidator implements ConstraintValidator&lt;EnumValue, String&gt; {\n    private EnumValue annotation;\n\n    @Override\n    public void initialize(EnumValue annotation) {\n        this.annotation = annotation;\n    }\n\n    @Override\n    public boolean isValid(String value, ConstraintValidatorContext context) {\n        if (value == null) {\n            return true; \n            \/\/ Consider null as valid. Use @NotNull for null check. \n        }\n        Class&lt;? extends Enum&lt;?&gt;&gt; enumClass = annotation.enumClass();\n        return Arrays.stream(enumClass.getEnumConstants()).anyMatch(e -&gt; e.name().equals(value));\n    }\n}<\/pre>\n<\/div>\n<\/section>\n<h4 style=\"margin-top: 16px; margin-bottom: 8px;\"><strong><span style=\"font-size: 18px;\">6. \u5728Controller\u4e2d\u4f7f\u7528\u81ea\u5b9a\u4e49\u6ce8\u89e3<\/span><\/strong><\/h4>\n<section style=\"margin-bottom: 8px;\"><span style=\"font-size: 16px;\">\u73b0\u5728\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Controller\u4e2d\u4f7f\u7528\u81ea\u5b9a\u4e49\u6ce8\u89e3\u6765\u6821\u9a8c\u679a\u4e3e\u503c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8bController\uff1a<\/span><\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<div>\n<pre>import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RestController;\n\nimport javax.validation.Valid;\nimport javax.validation.constraints.NotNull;\n\n@RestControllerpublic\nclass ColorController {\n    @GetMapping(\"\/color\")\n    public String getColor(@Valid @EnumValue(enumClass = Color.class) @RequestParam @NotNull String color) {\n        return \"Selected color: \" + color;\n    }\n}<\/pre>\n<\/div>\n<\/section>\n<section style=\"margin-bottom: 0px;\"><span style=\"font-size: 16px;\">\u5728\u4e0a\u8ff0\u793a\u4f8b\u4e2d\uff0c@EnumValue\u6ce8\u89e3\u786e\u4fddcolor\u53c2\u6570\u7684\u503c\u5fc5\u987b\u662fColor\u679a\u4e3e\u4e2d\u7684\u4e00\u4e2a\u3002\u5982\u679c\u8f93\u5165\u65e0\u6548\u503c\uff0cSpring\u4f1a\u81ea\u52a8\u8fd4\u56de400\u9519\u8bef\u3002<\/span><\/section>\n<h4 style=\"margin-top: 16px; margin-bottom: 8px;\"><strong><span style=\"font-size: 18px;\">7. \u603b\u7ed3<\/span><\/strong><\/h4>\n<p><span style=\"font-size: 16px;\">\u901a\u8fc7\u81ea\u5b9a\u4e49\u6ce8\u89e3EnumValue\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Spring\u5e94\u7528\u4e2d\u4f18\u96c5\u5730\u6821\u9a8c\u679a\u4e3e\u503c\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u7b80\u5316\u4e86\u6821\u9a8c\u903b\u8f91\uff0c\u8fd8\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u4f60\u5728\u9879\u76ee\u4e2d\u66f4\u597d\u5730\u5b9e\u73b0\u679a\u4e3e\u503c\u6821\u9a8c\u3002\u5982\u679c\u4f60\u6709\u4efb\u4f55\u95ee\u9898\u6216\u5efa\u8bae\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u3002<\/span><\/p>\n<p style=\"text-align: center; margin-bottom: 0px;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg lazyload\" style=\"height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222716115.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100001294\" data-ratio=\"0.3794642857142857\" data-s=\"300,640\" data-type=\"png\" data-w=\"896\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" style=\"height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222716115.png\" data-imgfileid=\"100001294\" data-ratio=\"0.3794642857142857\" data-s=\"300,640\" data-type=\"png\" data-w=\"896\" \/><\/noscript><\/p>\n<section style=\"margin: 0px 0px 8px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: pre-line; line-height: 30px; color: #4a4a4a; font-family: Avenir, -apple-system-font, \u5fae\u8f6f\u96c5\u9ed1, sans-serif;\"><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #78acfe; font-size: 15px;\">\u83b7\u53d6\u65b9\u5f0f\uff1a\u70b9\u201c<\/span><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; line-height: 30px; color: #3da742; font-size: 18px;\">\u5728\u770b<\/span><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #78acfe; font-size: 15px;\">\u201d\uff0c\u5173\u6ce8\u516c\u4f17\u53f7\u5e76\u56de\u590d\u3010<\/span><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #3da742; font-size: 18px;\">Java\u30011024\u3001AI\u3001\u6e38\u620f<\/span><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #78acfe; font-size: 15px;\">\u3011<\/span><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #78acfe; font-size: 15px;\">\u9886\u53d6\uff0c<\/span><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #78acfe; font-size: 15px;\">\u66f4\u591a\u5185\u5bb9\u9646\u7eed\u5949\u4e0a\u3002<\/span><\/section>\n<section style=\"margin: 0px 0px 10px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; white-space: normal; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; text-align: right; line-height: 1.6; color: #3f3f3f;\"><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; text-align: left; font-size: 15px; color: rgba(0, 0, 0, 0.8); font-family: Optima-Regular, PingFangTC-light;\">PS\uff1a\u56e0\u516c\u4f17\u53f7\u5e73\u53f0\u66f4\u6539\u4e86\u63a8\u9001\u89c4\u5219\uff0c\u5982\u679c\u4e0d\u60f3\u9519\u8fc7\u5185\u5bb9\uff0c\u8bb0\u5f97\u8bfb\u5b8c\u70b9\u4e00\u4e0b<\/span><strong style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; text-align: left; color: rgba(0, 0, 0, 0.8); font-family: Optima-Regular, PingFangTC-light; font-size: 12px;\">\u201c<span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #ff0000;\">\u5728\u770b<\/span>\u201d<\/strong><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; text-align: left; font-size: 15px; color: rgba(0, 0, 0, 0.8); font-family: Optima-Regular, PingFangTC-light;\">\uff0c\u52a0\u4e2a<\/span><strong style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; text-align: left; color: rgba(0, 0, 0, 0.8); font-family: Optima-Regular, PingFangTC-light; font-size: 12px;\">\u201c<span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: #ff0000;\">\u661f\u6807<\/span>\u201d<\/strong><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; text-align: left; font-size: 15px; color: rgba(0, 0, 0, 0.8); font-family: Optima-Regular, PingFangTC-light;\">\uff0c\u8fd9\u6837\u6bcf\u6b21\u65b0\u6587\u7ae0\u63a8\u9001\u624d\u4f1a\u7b2c\u4e00\u65f6\u95f4\u51fa\u73b0\u5728\u4f60\u7684\u8ba2\u9605\u5217\u8868\u91cc\u3002<\/span><\/section>\n<p style=\"margin: 10px 0px 0px; padding: 8px 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; clear: both; min-height: 1em; white-space: normal; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; text-align: right; line-height: 1.6; color: #3f3f3f;\"><span style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; letter-spacing: 0.544px; text-align: left; font-size: 15px; font-family: Optima-Regular, PingFangTC-light; visibility: visible; color: #ff0000;\">\u70b9<strong style=\"margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;\">\u201c\u5728\u770b\u201d<\/strong>\u652f\u6301\u7801\u519c\u5440\uff0c\u8c22\u8c22\u5566<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"width: 578px; height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222801204.gif\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-galleryid=\"\" data-imgfileid=\"100001293\" data-ratio=\"0.06442577030812324\" data-type=\"gif\" data-w=\"1071\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"width: 578px; height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222801204.gif\" data-galleryid=\"\" data-imgfileid=\"100001293\" data-ratio=\"0.06442577030812324\" data-type=\"gif\" data-w=\"1071\" \/><\/noscript><\/p>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u65b0\u751f\u4ee3\u7801\u519c<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u70b9\u51fb\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u66f4\u591a\u8d44\u8baf\u53ca\u65f6\u63a8\u9001\u2193 \u5728Spring\u6846\u67b6\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u5bf9\u8bf7\u6c42\u53c2\u6570\u8fdb\u884c\u6821\u9a8c\uff0c\u5c24\u5176\u662f\u5bf9\u679a\u4e3e\u503c\u7684\u6821\u9a8c\u3002\u4e3a\u4e86\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb &#8230;<\/p>\n","protected":false},"author":1,"featured_media":5804,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-5833","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222658299-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222716115.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222658299-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222658299-1024x435.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222716115.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222658299-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222658299-1024x435.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222658299.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222716115.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222716115.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222801204.gif","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/08\/20240801222801204.gif","id":"image3"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2024-08-01","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":543,"next_post_id":5843,"next_post_title":"Vue\u6253\u5305\u6587\u4ef6dist\u653e\u5728SpringBoot\u9879\u76ee\u4e0b\u8fd0\u884c\uff08\u6b63\u786e\u5b9e\u73b0\u5168\u8fc7\u7a0b\uff09","previous_post_id":6201,"previous_post_title":"springboot + rabbitmq\u5b9e\u73b0\u90ae\u4ef6\u53d1\u9001\uff0c\u4fdd\u8bc1\u6d88\u606f100%\u6295\u9012\u6210\u529f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5833","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=5833"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5833\/revisions"}],"predecessor-version":[{"id":6450,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/5833\/revisions\/6450"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/5804"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=5833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=5833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=5833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}