{"id":753,"date":"2023-05-28T02:11:04","date_gmt":"2023-05-27T18:11:04","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=753"},"modified":"2023-05-28T02:11:04","modified_gmt":"2023-05-27T18:11:04","slug":"spring-ioc%e7%b3%bb%e5%88%97%e4%b9%8bconditional%e6%b3%a8%e8%a7%a3%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e5%8e%9f%e7%90%86%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/spring-ioc%e7%b3%bb%e5%88%97%e4%b9%8bconditional%e6%b3%a8%e8%a7%a3%e7%9a%84%e4%bd%bf%e7%94%a8%e5%92%8c%e5%8e%9f%e7%90%86%e8%a7%a3%e6%9e%90\/","title":{"rendered":"Spring IOC\u7cfb\u5217\u4e4b@Conditional\u6ce8\u89e3\u7684\u4f7f\u7528\u548c\u539f\u7406\u89e3\u6790"},"content":{"rendered":"<div class='wxsyncmain'>\n<section><mp-common-profile class=\"js_uneditable custom_select_card mp_profile_iframe\" data-pluginname=\"mpprofile\" data-weui-theme=\"light\" data-id=\"MzI3ODE5MzczNA==\" data-headimg=\"http:\/\/mmbiz.qpic.cn\/mmbiz_png\/OC2PjnBlMZjic6L6UHJXiaT0JCXiapkjUlh1wc5YRxBr1FvF4JB2kMibDia0m1vPHLtKr1BMxWm2QeGBRJhiaicbicw00w\/0?wx_fmt=png\" data-nickname=\"\u5218\u724c\" data-alias=\"\" data-signature=\"\u5bfb\u5e38\u7684\u74e6\u820d\u8bc4\u4e66\uff0c\u6697\u85cf\u7740\u6551\u4e16\u79d8\u8bc0\u3002\" data-from=\"0\" data-is_biz_ban=\"0\"><\/mp-common-profile><\/section>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;color: black;padding-right: 10px;padding-left: 10px;line-height: 1.6;letter-spacing: 0px;word-break: break-word;overflow-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\">\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 22px;display: flex;justify-content: center;border-width: initial;border-style: none;border-color: initial;color: rgb(130, 127, 196);\"><span style=\"display: block;width: 35px;height: 35px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');margin-right: -20px;\"><\/span><span style=\"display: flex;align-items: center;font-size: 18px;\">\u4ecb\u7ecd<\/span><span style=\"display: block;width: 15px;height: 15px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');\"><\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u4eca\u5929\u8981\u5206\u4eab\u7684\u662fSpring\u7684\u6ce8\u89e3@Conditional\uff0c@Conditional\u662f\u4e00\u4e2a\u6761\u4ef6\u6ce8\u89e3\uff0c\u5b83\u7684\u4f5c\u7528\u662f\u5224\u65adBean\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\uff0c\u5982\u679c\u6ee1\u8db3\u6761\u4ef6\uff0c\u5219\u5c06Bean\u6ce8\u518c\u8fdbIOC\u4e2d\uff0c\u5982\u679c\u4e0d\u6ee1\u8db3\u6761\u4ef6\uff0c\u5219\u4e0d\u8fdb\u884c\u6ce8\u518c\uff0c\u8fd9\u4e2a\u6ce8\u89e3\u5728SpringBoot\u4e2d\u884d\u751f\u51fa\u5f88\u591a\u6ce8\u89e3\uff0c\u6bd4\u5982<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(30, 107, 184);background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">@ConditionalOnProperty<\/code>\uff0c<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(30, 107, 184);background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">@ConditionalOnBean<\/code>\uff0c<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(30, 107, 184);background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">@ConditionalOnClass<\/code>\u7b49\u7b49\uff0c\u5728SpringBoot\u4e2d\uff0c\u8fd9\u4e9b\u6ce8\u89e3\u7528\u5f97\u5f88\u591a\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 22px;display: flex;justify-content: center;border-width: initial;border-style: none;border-color: initial;color: rgb(130, 127, 196);\"><span style=\"display: block;width: 35px;height: 35px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');margin-right: -20px;\"><\/span><span style=\"display: flex;align-items: center;font-size: 18px;\">\u6587\u4ef6\u7cfb\u7edf\u573a\u666f<\/span><span style=\"display: block;width: 15px;height: 15px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');\"><\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u4e0b\u9762\u6211\u4eec\u6f14\u793a\u4e00\u4e9b@Conditional\u7684\u4f7f\u7528\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u6587\u4ef6\u7cfb\u7edf\u662f\u5fc5\u987b\u7684\uff0c\u4f46\u662f\u7cfb\u7edf\u7684\u7279\u70b9\u4e0d\u4e00\u6837\uff0c\u6709\u4e9b\u7528\u6237\u5e0c\u671b\u5c06\u6587\u4ef6\u4fdd\u5b58\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u6709\u4e9b\u7528\u6237\u5219\u6ca1\u8fd9\u79cd\u8981\u6c42\uff0c\u8fd9\u65f6\u5019\uff0c\u6587\u4ef6\u53ef\u4ee5\u4fdd\u5b58\u5728\u4e91\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u4fdd\u5b58\u5728\u81ea\u5efa\u6587\u4ef6\u7cfb\u7edf\u4e0a\uff0c\u90a3\u4e48\u9762\u5bf9\u4e0d\u540c\u7528\u6237\u7684\u9700\u6c42\uff0c\u6211\u4eec\u7684\u8f6f\u4ef6\u4e5f\u8981\u80fd\u591f\u9002\u914d\u4e0d\u540c\u7684\u73af\u5883\uff0c\u53ea\u9700\u8981\u7b80\u5355\u7684\u914d\u7f6e\u5373\u53ef\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u5047\u8bbe\u6211\u4eec\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7684\u6587\u4ef6\u5168\u90e8\u6258\u7ba1\u5728\u4e91\u670d\u52a1\u5382\u5546\u7684OSS\u4e0a\uff0c\u4ee3\u7801\u903b\u8f91\u4e5f\u6ca1\u6709\u9884\u7559\u6269\u5c55\uff0c\u90a3\u4e48\u5f53\u7528\u6237\u9700\u8981\u79c1\u6709\u5316\u90e8\u7f72\uff0c\u6211\u4eec\u53ef\u80fd\u5c31\u9700\u8981\u66f4\u6539\u6587\u4ef6\u5b58\u50a8\u8fd9\u8fb9\u7684\u903b\u8f91\uff0c\u8fd9\u6837\u7684\u8bbe\u8ba1\u662f\u4e0d\u5408\u7406\u7684\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u6211\u4eec\u60f3\u4e00\u60f3\uff0c\u6587\u4ef6\u5b58\u50a8\u7684\u4ee3\u7801\u903b\u8f91\u662f\u4e0d\u540c\u7684\uff0c\u5404\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684\u5b9e\u73b0\u65b9\u5f0f\u548c\u4f7f\u7528API\u5404\u4e0d\u76f8\u540c\uff0c\u4f46\u662f\u5b83\u4eec\u6709\u4e00\u4e2a\u5171\u6027\uff0c\u90a3\u5c31\u662f\u80fd\u591f\u4e0a\u4f20\u6587\u4ef6\uff0c\u4e0b\u8f7d\u6587\u4ef6\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u5c31\u5e94\u8be5\u62bd\u8c61\u51fa\u4e00\u4e2a\u516c\u5171\u63a5\u53e3\uff0c\u4e0b\u9762\u6709\u4e0d\u540c\u7684\u5b9e\u73b0\uff0c\u6bd4\u5982Minio\u7684\u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d\u7b49\u903b\u8f91\u5c31\u4f7f\u7528Minio API\u53bb\u5b9e\u73b0\uff0cFastDFS\u5c31\u4f7f\u7528FastDFS\uff0cOSS\u5c31\u4f7f\u7528OSS\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u7f16\u5199\u5bf9\u5e94\u7684\u4ee3\u7801\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 22px;display: flex;justify-content: center;border-width: initial;border-style: none;border-color: initial;color: rgb(130, 127, 196);\"><span style=\"display: block;width: 35px;height: 35px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');margin-right: -20px;\"><\/span><span style=\"display: flex;align-items: center;font-size: 18px;\">\u7f16\u7801\u5b9e\u73b0<\/span><span style=\"display: block;width: 15px;height: 15px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');\"><\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u4ee5\u4e0b\u901a\u8fc7\u7f16\u7801\u5b9e\u73b0\u4e0d\u540c\u6587\u4ef6\u7cfb\u7edf\u7684\u903b\u8f91\u5b9e\u73b0\u9694\u79bb\uff0c\u7edf\u4e00\u63d0\u4f9b\u63a5\u53e3\u7684\u65b9\u6848\uff0c\u4e00\u822c\u6211\u4eec\u90fd\u4f1a\u5c06\u914d\u7f6e\u4fe1\u606f\u5199\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u4f7f\u7528storageType\u4ee3\u8868\u6587\u4ef6\u5b58\u50a8\u7c7b\u578b\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span>\u6587\u4ef6\u4e0a\u4f20\u63a5\u53e3<span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u5728StorageService\u63a5\u53e3\u4e2d\uff0c\u53ea\u7b80\u5355\u5b9a\u4e49\u4e86\u4e24\u4e2a\u65b9\u6cd5init()\u548cput()\uff0cinit()\u5c31\u662f\u505a\u4e00\u4e9b\u521d\u59cb\u5316\u64cd\u4f5c\uff0c\u6bd4\u5982\u53c2\u6570\u914d\u7f6e\uff0c\u8fde\u63a5\u7b49\uff0cput()\u5c31\u662f\u4e0a\u4f20\u6587\u4ef6\u63a5\u53e3\u3002<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background: url(&quot;https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015853135.jpeg&quot;) 10px 10px \/ 40px no-repeat rgb(40, 44, 52);height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;\"><\/span><code style=\"overflow-x: auto;padding: 16px;color: #abb2bf;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #282c34;border-radius: 5px;\"><span style=\"color: #c678dd;line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">MinioStorageCondition<\/span>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">Condition<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">boolean<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">matches<\/span><span style=\"line-height: 26px;\">(ConditionContext&nbsp;context,&nbsp;AnnotatedTypeMetadata&nbsp;metadata)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;storageType&nbsp;=&nbsp;context.getEnvironment().getProperty(<span style=\"color: #98c379;line-height: 26px;\">\"storageType\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: #98c379;line-height: 26px;\">\"minio\"<\/span>.equals(storageType);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 22px;display: flex;justify-content: center;border-width: initial;border-style: none;border-color: initial;color: rgb(130, 127, 196);\"><span style=\"display: block;width: 35px;height: 35px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');margin-right: -20px;\"><\/span><span style=\"display: flex;align-items: center;font-size: 18px;\">\u6e90\u7801\u89e3\u6790<\/span><span style=\"display: block;width: 15px;height: 15px;background-size: 100% 100%;background-repeat: no-repeat;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015847523.png');\"><\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">spring\u5728\u626b\u63cfbean\u7684\u65f6\u5019\uff0c\u4f1a\u5224\u65ad\u5bf9\u5e94\u7684bean\u662f\u5426\u6709@Conditional\u6ce8\u89e3\uff0c\u5982\u679c\u6709\uff0c\u5219\u4f1a\u8fdb\u5165value\u4e2d\u7684\u7c7b\uff0c\u8fdb\u53bb\u5224\u65ad\u662f\u5426\u7b26\u5408\u6761\u4ef6\uff0c\u5982\u679c\u7b26\u5408\uff0c\u5219\u8fd4\u56detrue\uff0c\u5c31\u80fd\u591f\u6ce8\u518c\uff0c\u5b9e\u9645\u4e0a\u5982\u679c\u7b26\u5408\u6761\u4ef6\uff0c\u90a3\u4e48\u5c31\u80fd\u5c06BeanDefinition\u6ce8\u518c\u8fdbBeanFactory\uff0c\u5982\u679c\u4e0d\u7b26\u5408\uff0c\u81ea\u7136\u4e0d\u80fd\u6ce8\u518c\u8fdb\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u5982\u4e0b\u662f\u6e90\u7801\u7684\u65f6\u5e8f\u56fe<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-ratio=\"0.5037037037037037\" data-s=\"300,640\"  data-type=\"png\" data-w=\"1080\" style=\"\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015850961.png\" 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-galleryid=\"\" data-ratio=\"0.5037037037037037\" data-s=\"300,640\"  data-type=\"png\" data-w=\"1080\" style=\"\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015850961.png\"><\/noscript><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u4ece\u4e0a\u9762\u7684\u65f6\u5e8f\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u6574\u4e2a\u8fc7\u7a0b\u6d89\u53ca\u7684\u7c7b\u8fd8\u662f\u633a\u591a\u7684\uff0c\u4e0d\u8fc7\u8fd9\u8fd8\u4e0d\u662f\u5b8c\u6574\u6d41\u7a0b\uff0c\u53ea\u662f\u4ece\u626b\u63cf\u7c7b\u5f00\u59cb\uff0cSpring\u4f1a\u626b\u63cf\u5de5\u7a0b\u8def\u5f84\u4e0b\u7684\u7c7b\uff0c\u8fd9\u4e2a\u8def\u5f84\u53ef\u4ee5\u901a\u8fc7@ComponentScan\u8fdb\u884c\u6307\u5b9a\uff0c\u5982\u679c\u662fSpringBoot\u9879\u76ee\uff0c\u5219\u5c31\u4e3a\u5f53\u524d\u5de5\u7a0b\uff0c\u7136\u540e\u7b5b\u9009\u51fa\u9700\u8981\u6ce8\u518c\u7684bean\u5e76\u6ce8\u518c\u5230BeanFactory\uff0c\u5bf9\u4e8e\u6807\u6ce8\u6709@Conditional\u6ce8\u89e3\u7684\u7c7b\uff0c\u4f1a\u8fdb\u5165@Conditional\u4e2dvalue\u7684\u7c7b\u4e2d\uff0c\u5c31\u662f\u4e0a\u9762\u7684<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(30, 107, 184);background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">MinioStorageCondition<\/code>\u6216\u8005<code style=\"font-size: 14px;overflow-wrap: break-word;padding: 2px 4px;border-radius: 4px;margin-right: 2px;margin-left: 2px;color: rgb(30, 107, 184);background-color: rgba(27, 31, 35, 0.05);font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;\">FastDFSStorageCondition<\/code>\uff0c\u7136\u540e\u8fdb\u884c\u5339\u914d\uff0c\u4e0d\u6ee1\u8db3\u6761\u4ef6\u7684\u5219\u4e0d\u4f1a\u88ab\u6ce8\u518c\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">@Conditional\u7684\u5177\u4f53\u6d41\u7a0b\u4e5f\u6bd4\u8f83\u7b80\u5355\uff0c\u5c31\u4e0d\u4e00\u4e00\u8d58\u8ff0\uff0c\u53ef\u4ee5\u770b\u7740\u4e0a\u9762\u7684\u65f6\u5e8f\u56fe\u53bb\u770b\u6e90\u7801\u5b9e\u73b0\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 20px;\"><span style=\"display: none;\"><\/span>\u603b\u7ed3<span style=\"display: none;\"><\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;font-size: 15px;\">\u4e0a\u9762\u5bf9@Conditional\u7684\u4f7f\u7528\uff0c\u539f\u7406\u7b49\u8fdb\u884c\u7b80\u5355\u7684\u4ecb\u7ecd\uff0c@Conditional\u6ce8\u89e3\u5728SpringBoot\u4e2d\u7528\u5f97\u8fd8\u662f\u6bd4\u8f83\u591a\u7684\uff0c\u7279\u522b\u662f\u5b83\u884d\u751f\u51fa\u6765\u7684\u4e00\u4e9b\u6ce8\u89e3\uff0c\u8fd9\u4e9b\u6ce8\u89e3\u90fd\u662f\u57fa\u4e8e\u5b83\u6765\u8fdb\u884c\u4e8c\u6b21\u5c01\u88c5\u7684\uff0c\u5728SpringBoot\u4e2d\uff0c\u5bf9\u4e8e\u5f88\u591astarter\uff0c\u91cc\u9762\u51e0\u4e4e\u90fd\u4f1a\u6709@Conditional\u548c@Conditional\u884d\u751f\u6ce8\u89e3\u7684\u4f7f\u7528\uff0c\u6211\u4eec\u540e\u7eed\u4f1a\u6311\u9009\u51fa\u4e00\u4e9b\u6765\u8bf4\u3002<\/p>\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-top: none;border-right: none;border-bottom: none;font-size: 0.9em;overflow: auto;border-left-color: rgba(0, 0, 0, 0.4);background: rgba(0, 0, 0, 0.05);color: rgb(106, 115, 125);padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;color: black;line-height: 26px;font-size: 15px;\">\u4eca\u5929\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\uff0c\u611f\u8c22\u4f60\u7684\u89c2\u770b\uff0c\u6211\u4eec\u4e0b\u671f\u89c1\uff01<\/p>\n<\/blockquote>\n<\/section>\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:                 \u5218\u724c              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u7ecd \u4eca\u5929\u8981\u5206\u4eab\u7684\u662fSpring\u7684\u6ce8\u89e3@Conditional\uff0c@Conditional\u662f\u4e00\u4e2a\u6761\u4ef6\u6ce8\u89e3\uff0c\u5b83\u7684\u4f5c\u7528\u662f\u5224\u65adBean\u662f\u5426 &#8230;<\/p>\n","protected":false},"author":2,"featured_media":750,"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-753","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\/2023\/05\/20230528015848676-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015850961.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015848676-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015848676-1024x435.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015850961.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015848676-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015848676-1024x435.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015848676.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015850961.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528015850961.png","id":"image1"}],"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":318,"next_post_id":1005,"next_post_title":"\u6570\u636e\u5e93\u94fe\u63a5\u6c60\u7ec8\u4e8e\u641e\u5bf9\u4e86\uff0c\u8fd9\u6b21\u76f4\u63a5\u4ece100ms\u4f18\u5316\u52303ms\uff01","previous_post_id":917,"previous_post_title":"Spring-15 Spring Certified Professional \u8bd5\u9898\u6574\u7406 \u2460","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/753","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/753\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/750"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}