{"id":34,"date":"2024-08-05T10:25:37","date_gmt":"2024-08-05T02:25:37","guid":{"rendered":"https:\/\/note.ui11.cc\/?p=34"},"modified":"2024-08-13T17:53:03","modified_gmt":"2024-08-13T09:53:03","slug":"%e6%b3%a8%e8%a7%a3%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/note.ui11.cc\/index.php\/2024\/08\/05\/%e6%b3%a8%e8%a7%a3%e6%80%bb%e7%bb%93\/","title":{"rendered":"\u6ce8\u89e3\u603b\u7ed3"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\"><br><br><\/pre>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@Requestbody<\/summary>\n<p>@RequestBody \u662f\u4e00\u4e2a\u5728Java Web\u5f00\u53d1\u4e2d\u5e38\u7528\u7684\u6ce8\u89e3\uff0c\u7279\u522b\u662f\u5728\u4f7f\u7528Spring\u6846\u67b6\u65f6\u3002\u5b83\u4e3b\u8981\u7528\u4e8e\u5c06HTTP\u8bf7\u6c42\u4f53\u4e2d\u7684\u6570\u636e\u7ed1\u5b9a\u5230\u65b9\u6cd5\u7684\u53c2\u6570\u4e0a\u3002\u8fd9\u4e2a\u6ce8\u89e3\u901a\u5e38\u7528\u4e8e\u5904\u7406POST\u8bf7\u6c42\u4e2d\u7684\u8868\u5355\u6570\u636e\u6216JSON\u6570\u636e\u3002\u901a\u8fc7@RequestBody\u6ce8\u89e3\uff0c\u53ef\u4ee5\u5c06\u8bf7\u6c42\u4f53\u4e2d\u7684\u6570\u636e\u8f6c\u6362\u4e3a\u6307\u5b9a\u7684\u5bf9\u8c61\u7c7b\u578b\uff0c\u4ece\u800c\u65b9\u4fbf\u5728\u65b9\u6cd5\u4e2d\u8fdb\u884c\u5904\u7406\u3002<br>\u57fa\u672c\u7528\u6cd5<br>1.<br>\u5904\u7406JSON\u6570\u636e\uff1a\u5f53\u5ba2\u6237\u7aef\u53d1\u9001POST\u8bf7\u6c42\u65f6\uff0c\u8bf7\u6c42\u4f53\u4e2d\u7684JSON\u6570\u636e\u53ef\u4ee5\u81ea\u52a8\u8f6c\u6362\u4e3aJava\u5bf9\u8c61\uff0c\u5e76\u4f20\u9012\u7ed9\u63a7\u5236\u5668\uff08Controller\uff09\u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5ba2\u6237\u7aef\u53d1\u9001\u4e86\u4e00\u4e2a\u5305\u542b\u7528\u6237\u540d\u548c\u5bc6\u7801\u7684JSON\u5bf9\u8c61\uff0c\u63a7\u5236\u5668\u7684\u65b9\u6cd5\u53ef\u4ee5\u4f7f\u7528@RequestBody\u6ce8\u89e3\u6765\u63a5\u6536\u8fd9\u4e2aJSON\u5bf9\u8c61\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u76f8\u5e94\u7684Java\u5bf9\u8c61\u3002<\/p>\n\n\n\n<p>@RestController<br>public class UserController {<br>    @PostMapping(&#8220;\/login&#8221;)<br>    public ResponseEntity&lt;User&gt; login(@RequestBody User user) {<br>        \/\/ \u5904\u7406\u7528\u6237\u767b\u5f55\u903b\u8f91<br>        return ResponseEntity.ok(user);<br>    }<br>}<br>2.<br>\u5904\u7406\u8868\u5355\u6570\u636e\uff1a\u867d\u7136@RequestBody\u4e3b\u8981\u7528\u4e8e\u5904\u7406JSON\u6570\u636e\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5904\u7406\u8868\u5355\u6570\u636e\u3002\u5f53\u8bf7\u6c42\u7684Content-Type\u4e3aapplication\/x-www-form-urlencoded\u65f6\uff0c@RequestBody\u53ef\u4ee5\u5c06\u8bf7\u6c42\u4f53\u4e2d\u7684\u8868\u5355\u6570\u636e\u7ed1\u5b9a\u5230\u65b9\u6cd5\u7684\u53c2\u6570\u4e0a\u3002<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@Bean<\/summary>\n<p>\u5728Java\u7684Spring\u6846\u67b6\u4e2d\uff0c<code>@Bean<\/code>&nbsp;\u6ce8\u89e3\u7528\u4e8e\u5728Spring\u5bb9\u5668\u4e2d\u58f0\u660e\u4e00\u4e2abean\u3002\u8fd9\u4e2a\u6ce8\u89e3\u901a\u5e38\u7528\u5728\u65b9\u6cd5\u4e0a\uff0c\u8868\u660e\u8be5\u65b9\u6cd5\u4f1a\u8fd4\u56de\u4e00\u4e2a\u5bf9\u8c61\uff0cSpring\u5bb9\u5668\u4f1a\u7ba1\u7406\u8fd9\u4e2a\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f\u3002\u4f7f\u7528&nbsp;<code>@Bean<\/code>&nbsp;\u6ce8\u89e3\u7684\u65b9\u6cd5\u901a\u5e38\u4f4d\u4e8e\u5e26\u6709&nbsp;<code>@Configuration<\/code>&nbsp;\u6ce8\u89e3\u7684\u7c7b\u4e2d\uff0c\u8fd9\u6837\u7684\u7c7b\u88ab\u89c6\u4e3a\u914d\u7f6e\u7c7b\u3002<\/p>\n\n\n\n<p>\u5f53Spring\u5bb9\u5668\u542f\u52a8\u65f6\uff0c\u5b83\u4f1a\u67e5\u627e\u5e26\u6709&nbsp;<code>@Configuration<\/code>&nbsp;\u6ce8\u89e3\u7684\u7c7b\uff0c\u5e76\u6267\u884c\u8fd9\u4e9b\u7c7b\u4e2d\u7684\u5e26\u6709&nbsp;<code>@Bean<\/code>&nbsp;\u6ce8\u89e3\u7684\u65b9\u6cd5\uff0c\u5c06\u8fd4\u56de\u7684\u5bf9\u8c61\u6ce8\u518c\u4e3aSpring\u7ba1\u7406\u7684bean\u3002<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528&nbsp;<code>@Bean<\/code>&nbsp;\u6ce8\u89e3\uff1a<\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class AppConfig { @Bean public MyService myService() { return new MyServiceImpl(); } }<\/p>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>AppConfig<\/code>&nbsp;\u7c7b\u88ab\u6807\u8bb0\u4e3a\u914d\u7f6e\u7c7b\uff0c\u56e0\u4e3a\u5b83\u5e26\u6709&nbsp;<code>@Configuration<\/code>&nbsp;\u6ce8\u89e3\u3002<code>myService<\/code>&nbsp;\u65b9\u6cd5\u88ab\u6807\u8bb0\u4e3a&nbsp;<code>@Bean<\/code>\uff0c\u610f\u5473\u7740Spring\u5bb9\u5668\u4f1a\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u5e76\u5c06\u8fd4\u56de\u7684\u5bf9\u8c61\uff08<code>MyServiceImpl<\/code>&nbsp;\u7684\u4e00\u4e2a\u5b9e\u4f8b\uff09\u6ce8\u518c\u4e3a\u4e00\u4e2abean\u3002\u8fd9\u4e2abean\u5728Spring\u5e94\u7528\u4e2d\u53ef\u4ee5\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165\uff08DI\uff09\u7684\u65b9\u5f0f\u88ab\u5176\u4ed6\u7ec4\u4ef6\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528&nbsp;<code>@Bean<\/code>&nbsp;\u6ce8\u89e3\u7684\u597d\u5904\u662f\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4ee5\u7f16\u7a0b\u7684\u65b9\u5f0f\u5b9a\u4e49bean\u7684\u521b\u5efa\u903b\u8f91\uff0c\u63d0\u4f9b\u4e86\u66f4\u5927\u7684\u7075\u6d3b\u6027\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u521b\u5efabean\u65f6\u6267\u884c\u4e00\u4e9b\u521d\u59cb\u5316\u64cd\u4f5c\uff0c\u6216\u8005\u6839\u636e\u4e0d\u540c\u7684\u6761\u4ef6\u8fd4\u56de\u4e0d\u540c\u7684bean\u5b9e\u4f8b\u3002<\/p>\n\n\n\n<p><code>@Bean<\/code>&nbsp;\u6ce8\u89e3\u8fd8\u53ef\u4ee5\u4e0e&nbsp;<code>@Scope<\/code>\u3001<code>@DependsOn<\/code>\u3001<code>@Lazy<\/code>&nbsp;\u7b49\u5176\u4ed6\u6ce8\u89e3\u4e00\u8d77\u4f7f\u7528\uff0c\u4ee5\u63a7\u5236bean\u7684\u8303\u56f4\u3001\u4f9d\u8d56\u5173\u7cfb\u548c\u521b\u5efa\u65f6\u673a\u7b49\u5c5e\u6027\u3002<\/p>\n\n\n\n<p><\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@Override<\/summary>\n<p>\u5728Java\u7f16\u7a0b\u8bed\u8a00\u4e2d\uff0c<code>@Override<\/code>&nbsp;\u662f\u4e00\u4e2a\u6ce8\u89e3\uff08Annotation\uff09\uff0c\u7528\u4e8e\u6307\u793a\u4e00\u4e2a\u65b9\u6cd5\u58f0\u660e\u6253\u7b97\u8986\u76d6\uff08override\uff09\u5728\u8d85\u7c7b\uff08superclass\uff09\u6216\u5b9e\u73b0\u7684\u63a5\u53e3\uff08interface\uff09\u4e2d\u7684\u4e00\u4e2a\u65b9\u6cd5\u3002\u4f7f\u7528&nbsp;<code>@Override<\/code>&nbsp;\u6ce8\u89e3\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u660e\u786e\u5730\u8868\u8fbe\u4ed6\u4eec\u7684\u610f\u56fe\uff0c\u5e76\u4e14\u8ba9\u7f16\u8bd1\u5668\u68c0\u67e5\u8be5\u65b9\u6cd5\u662f\u5426\u786e\u5b9e\u8986\u76d6\u4e86\u8d85\u7c7b\u6216\u63a5\u53e3\u4e2d\u7684\u4e00\u4e2a\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u5f53\u4f7f\u7528&nbsp;<code>@Override<\/code>&nbsp;\u6ce8\u89e3\u65f6\uff0c\u5982\u679c\u65b9\u6cd5\u6ca1\u6709\u6b63\u786e\u8986\u76d6\u8d85\u7c7b\u6216\u63a5\u53e3\u4e2d\u7684\u4efb\u4f55\u65b9\u6cd5\uff0c\u7f16\u8bd1\u5668\u5c06\u4f1a\u62a5\u9519\u3002\u8fd9\u6709\u52a9\u4e8e\u907f\u514d\u4e00\u4e9b\u5e38\u89c1\u7684\u9519\u8bef\uff0c\u6bd4\u5982\u62fc\u5199\u9519\u8bef\u6216\u65b9\u6cd5\u7b7e\u540d\u4e0d\u5339\u914d\u5bfc\u81f4\u7684\u65b9\u6cd5\u6ca1\u6709\u6b63\u786e\u8986\u76d6\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528&nbsp;<code>@Override<\/code>&nbsp;\u6ce8\u89e3\u7684\u4f8b\u5b50\uff1a<code>public class Animal { public void makeSound() { System.out.println(\"Animal makes a sound\"); } } public class Dog extends Animal { @Override public void makeSound() { System.out.println(\"Dog barks\"); } }<\/code>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0cDog&nbsp;\u7c7b\u4e2d\u7684&nbsp;makeSound&nbsp;\u65b9\u6cd5\u4f7f\u7528\u4e86&nbsp;@Override&nbsp;\u6ce8\u89e3\uff0c\u8868\u660e\u5b83\u6253\u7b97\u8986\u76d6&nbsp;Animal&nbsp;\u7c7b\u4e2d\u7684&nbsp;makeSound&nbsp;\u65b9\u6cd5\u3002\u5982\u679c&nbsp;Animal&nbsp;\u7c7b\u4e2d\u6ca1\u6709&nbsp;makeSound&nbsp;\u65b9\u6cd5\uff0c\u6216\u8005&nbsp;Dog&nbsp;\u7c7b\u4e2d\u7684&nbsp;makeSound&nbsp;\u65b9\u6cd5\u7b7e\u540d\u4e0e\u8d85\u7c7b\u4e2d\u7684\u4e0d\u5339\u914d\uff0c\u7f16\u8bd1\u5668\u5c06\u4f1a\u62a5\u9519\u3002<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary><code>@RestController<\/code><\/summary>\n<p>\u5728Spring\u6846\u67b6\u4e2d\uff0c<code>@RestController<\/code>&nbsp;\u662f\u4e00\u4e2a\u7ec4\u5408\u6ce8\u89e3\uff0c\u5b83\u7ed3\u5408\u4e86&nbsp;<code>@Controller<\/code>&nbsp;\u548c&nbsp;<code>@ResponseBody<\/code>&nbsp;\u6ce8\u89e3\u7684\u529f\u80fd\u3002<code>@RestController<\/code>&nbsp;\u7528\u4e8e\u521b\u5efaRESTful\u63a7\u5236\u5668\uff0c\u5b83\u544a\u8bc9Spring\u6846\u67b6\u8fd9\u4e2a\u7c7b\u662f\u4e00\u4e2a\u63a7\u5236\u5668\uff0c\u800c\u4e14\u5b83\u7684\u65b9\u6cd5\u8fd4\u56de\u7684\u503c\u5e94\u8be5\u76f4\u63a5\u5199\u5165HTTP\u54cd\u5e94\u4f53\u4e2d\uff0c\u800c\u4e0d\u662f\u89c6\u56fe\u540d\u79f0\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528&nbsp;<code>@RestController<\/code>&nbsp;\u6ce8\u89e3\u7684\u7c7b\u901a\u5e38\u7528\u4e8e\u5904\u7406Web\u8bf7\u6c42\uff0c\u5e76\u8fd4\u56de\u6570\u636e\u800c\u4e0d\u662f\u89c6\u56fe\u3002\u8fd9\u4e9b\u6570\u636e\u901a\u5e38\u662fJSON\u6216XML\u683c\u5f0f\uff0c\u7528\u4e8e\u6784\u5efaRESTful API\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528&nbsp;<code>@RestController<\/code>\uff1aimport org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class MyRestController { @GetMapping(&#8220;\/hello&#8221;) public String sayHello() { return &#8220;Hello, World!&#8221;; } }\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>MyRestController<\/code>&nbsp;\u7c7b\u4f7f\u7528\u4e86&nbsp;<code>@RestController<\/code>&nbsp;\u6ce8\u89e3\uff0c\u8868\u660e\u5b83\u662f\u4e00\u4e2aRESTful\u63a7\u5236\u5668\u3002<code>sayHello<\/code>&nbsp;\u65b9\u6cd5\u4f7f\u7528\u4e86&nbsp;<code>@GetMapping<\/code>&nbsp;\u6ce8\u89e3\uff0c\u8868\u793a\u5b83\u4f1a\u54cd\u5e94\u5bf9&nbsp;<code>\/hello<\/code>&nbsp;\u8def\u5f84\u7684GET\u8bf7\u6c42\u3002\u5f53\u8fd9\u4e2a\u8bf7\u6c42\u88ab\u53d1\u9001\u65f6\uff0c<code>sayHello<\/code>&nbsp;\u65b9\u6cd5\u4f1a\u8fd4\u56de\u5b57\u7b26\u4e32 &#8220;Hello, World!&#8221;\uff0c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u5c06\u76f4\u63a5\u4f5c\u4e3aHTTP\u54cd\u5e94\u4f53\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@ResponseBody<\/summary>\n<p>\u5728Spring\u6846\u67b6\u4e2d\uff0c<code>@ResponseBody<\/code>&nbsp;\u662f\u4e00\u4e2a\u6ce8\u89e3\uff0c\u7528\u4e8e\u6307\u793a\u4e00\u4e2a\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u5e94\u8be5\u76f4\u63a5\u5199\u5165HTTP\u54cd\u5e94\u4f53\u4e2d\u3002\u5f53\u4e00\u4e2a\u65b9\u6cd5\u88ab&nbsp;<code>@ResponseBody<\/code>&nbsp;\u6ce8\u89e3\u6807\u8bb0\u65f6\uff0cSpring MVC\u6846\u67b6\u4f1a\u81ea\u52a8\u5c06\u8be5\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u8f6c\u6362\u4e3a\u9002\u5f53\u7684\u683c\u5f0f\uff08\u5982JSON\u6216XML\uff09\uff0c\u5e76\u5c06\u5176\u4f5c\u4e3aHTTP\u54cd\u5e94\u53d1\u9001\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n\n\n\n<p><code>@ResponseBody<\/code>&nbsp;\u6ce8\u89e3\u901a\u5e38\u4e0e&nbsp;<code>@Controller<\/code>&nbsp;\u6216&nbsp;<code>@RestController<\/code>&nbsp;\u6ce8\u89e3\u4e00\u8d77\u4f7f\u7528\uff0c\u7528\u4e8e\u521b\u5efa\u5904\u7406Web\u8bf7\u6c42\u7684\u65b9\u6cd5\u3002\u5728\u4f7f\u7528&nbsp;<code>@RestController<\/code>&nbsp;\u65f6\uff0c\u6bcf\u4e2a\u65b9\u6cd5\u9ed8\u8ba4\u90fd\u662f&nbsp;<code>@ResponseBody<\/code>\uff0c\u56e0\u6b64\u901a\u5e38\u4e0d\u9700\u8981\u663e\u5f0f\u5730\u4f7f\u7528&nbsp;<code>@ResponseBody<\/code>&nbsp;\u6ce8\u89e3\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528&nbsp;<code>@ResponseBody<\/code>&nbsp;\u6ce8\u89e3\u7684\u4f8b\u5b50<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-21.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"420\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-21.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-86\"  sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/div><\/figure>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>MyController<\/code>&nbsp;\u7c7b\u4f7f\u7528\u4e86&nbsp;<code>@RestController<\/code>&nbsp;\u6ce8\u89e3\uff0c\u8868\u660e\u5b83\u662f\u4e00\u4e2aRESTful\u63a7\u5236\u5668\u3002<code>greeting<\/code>&nbsp;\u65b9\u6cd5\u4f7f\u7528\u4e86&nbsp;<code>@GetMapping<\/code>&nbsp;\u6ce8\u89e3\uff0c\u8868\u793a\u5b83\u4f1a\u54cd\u5e94\u5bf9&nbsp;<code>\/greeting<\/code>&nbsp;\u8def\u5f84\u7684GET\u8bf7\u6c42\u3002<code>@ResponseBody<\/code>&nbsp;\u6ce8\u89e3\u8868\u660e\u65b9\u6cd5\u8fd4\u56de\u7684\u5b57\u7b26\u4e32 &#8220;Hello, World!&#8221; \u5e94\u8be5\u76f4\u63a5\u5199\u5165HTTP\u54cd\u5e94\u4f53\u4e2d\u3002<\/p>\n\n\n\n<p>\u5f53\u5ba2\u6237\u7aef\u5411&nbsp;<code>\/greeting<\/code>&nbsp;\u53d1\u9001GET\u8bf7\u6c42\u65f6\uff0c<code>greeting<\/code>&nbsp;\u65b9\u6cd5\u4f1a\u88ab\u8c03\u7528\uff0c\u8fd4\u56de\u7684\u5b57\u7b26\u4e32 &#8220;Hello, World!&#8221; \u5c06\u76f4\u63a5\u4f5c\u4e3aHTTP\u54cd\u5e94\u4f53\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u8fd9\u79cd\u65b9\u5f0f\u5e38\u7528\u4e8e\u6784\u5efaRESTful Web\u670d\u52a1\uff0c\u5176\u4e2d\u54cd\u5e94\u901a\u5e38\u4ee5JSON\u6216XML\u683c\u5f0f\u8fd4\u56de\u3002<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@Controller<\/summary>\n<p>\u5728Spring\u6846\u67b6\u4e2d\uff0c<code>@Controller<\/code>&nbsp;\u6ce8\u89e3\u662f\u4e00\u4e2a\u7528\u4e8e\u6807\u8bb0\u7c7b\u7684\u6ce8\u89e3\uff0c\u5b83\u8868\u660e\u8be5\u7c7b\u662f\u4e00\u4e2aSpring MVC\u63a7\u5236\u5668\u3002\u63a7\u5236\u5668\uff08Controller\uff09\u662fMVC\uff08Model-View-Controller\uff09\u67b6\u6784\u6a21\u5f0f\u4e2d\u7684\u4e00\u4e2a\u7ec4\u4ef6\uff0c\u8d1f\u8d23\u5904\u7406\u7528\u6237\u8bf7\u6c42\u5e76\u8fd4\u56de\u54cd\u5e94\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528&nbsp;<code>@Controller<\/code>&nbsp;\u6ce8\u89e3\u7684\u7c7b\u53ef\u4ee5\u5305\u542b\u5904\u7406HTTP\u8bf7\u6c42\u7684\u65b9\u6cd5\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u901a\u5e38\u4f7f\u7528\u5176\u4ed6\u6ce8\u89e3\u5982&nbsp;<code>@GetMapping<\/code>,&nbsp;<code>@PostMapping<\/code>,&nbsp;<code>@PutMapping<\/code>,&nbsp;<code>@DeleteMapping<\/code>&nbsp;\u7b49\u6765\u6307\u5b9a\u5b83\u4eec\u5904\u7406\u7684\u8bf7\u6c42\u7c7b\u578b\u548c\u8def\u5f84\u3002<\/p>\n\n\n\n<p>\u5f53Spring\u5e94\u7528\u542f\u52a8\u65f6\uff0c\u5b83\u4f1a\u626b\u63cf\u5e26\u6709&nbsp;<code>@Controller<\/code>&nbsp;\u6ce8\u89e3\u7684\u7c7b\uff0c\u5e76\u5c06\u8fd9\u4e9b\u7c7b\u4e2d\u7684\u65b9\u6cd5\u6ce8\u518c\u4e3a\u5904\u7406\u7279\u5b9a\u8bf7\u6c42\u7684\u5904\u7406\u5668\u3002\u8fd9\u4e9b\u5904\u7406\u5668\u65b9\u6cd5\u53ef\u4ee5\u8fd4\u56de\u89c6\u56fe\u540d\u79f0\u3001\u6570\u636e\u6a21\u578b\u3001\u76f4\u63a5\u54cd\u5e94\u4f53\u5185\u5bb9\uff08\u4f7f\u7528&nbsp;<code>@ResponseBody<\/code>&nbsp;\u6216&nbsp;<code>@RestController<\/code>\uff09\u7b49\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528&nbsp;<code>@Controller<\/code>&nbsp;\u6ce8\u89e3\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-22.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"368\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-22.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-87\"  sizes=\"auto, (max-width: 703px) 100vw, 703px\" \/><\/div><\/figure>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>MyController<\/code>&nbsp;\u7c7b\u4f7f\u7528\u4e86&nbsp;<code>@Controller<\/code>&nbsp;\u6ce8\u89e3\uff0c\u8868\u660e\u5b83\u662f\u4e00\u4e2a\u63a7\u5236\u5668\u3002<code>sayHello<\/code>&nbsp;\u65b9\u6cd5\u4f7f\u7528\u4e86&nbsp;<code>@GetMapping<\/code>&nbsp;\u6ce8\u89e3\uff0c\u8868\u793a\u5b83\u4f1a\u54cd\u5e94\u5bf9&nbsp;<code>\/hello<\/code>&nbsp;\u8def\u5f84\u7684GET\u8bf7\u6c42\u3002\u5f53\u8fd9\u4e2a\u8bf7\u6c42\u88ab\u53d1\u9001\u65f6\uff0c<code>sayHello<\/code>&nbsp;\u65b9\u6cd5\u4f1a\u8fd4\u56de\u5b57\u7b26\u4e32 &#8220;hello&#8221;\uff0c\u8fd9\u901a\u5e38\u4f1a\u88abSpring\u89c6\u56fe\u89e3\u6790\u5668\u89e3\u6790\u4e3a\u4e00\u4e2a\u89c6\u56fe\u540d\u79f0\uff0c\u7528\u4e8e\u6e32\u67d3\u76f8\u5e94\u7684\u89c6\u56fe\u3002<\/p>\n\n\n\n<p><code>@Controller<\/code>&nbsp;\u6ce8\u89e3\u901a\u5e38\u4e0e&nbsp;<code>@RequestMapping<\/code>&nbsp;\u6216\u5176\u6d3e\u751f\u6ce8\u89e3\uff08\u5982&nbsp;<code>@GetMapping<\/code>,&nbsp;<code>@PostMapping<\/code>&nbsp;\u7b49\uff09\u4e00\u8d77\u4f7f\u7528\uff0c\u4ee5\u5b9a\u4e49\u63a7\u5236\u5668\u65b9\u6cd5\u5904\u7406\u7684\u8bf7\u6c42\u8def\u5f84\u548c\u7c7b\u578b\u3002\u6b64\u5916\uff0c<code>@Controller<\/code>&nbsp;\u7c7b\u53ef\u4ee5\u4e0e&nbsp;<code>@Service<\/code>&nbsp;\u548c&nbsp;<code>@Repository<\/code>&nbsp;\u6ce8\u89e3\u7684\u7c7b\u4e00\u8d77\uff0c\u6784\u6210\u5178\u578b\u7684\u5206\u5c42\u67b6\u6784\u3002<\/p>\n<\/details>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@ExceptionHandler<\/summary>\n<p>\u5728Spring\u6846\u67b6\u4e2d\uff0c<code>@ExceptionHandler<\/code>&nbsp;\u662f\u4e00\u4e2a\u6ce8\u89e3\uff0c\u7528\u4e8e\u5904\u7406\u63a7\u5236\u5668\uff08Controller\uff09\u4e2d\u629b\u51fa\u7684\u5f02\u5e38\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e2a\u6ce8\u89e3\uff0c\u4f60\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u65b9\u6cd5\u6765\u5904\u7406\u7279\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684\u54cd\u5e94\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>\n\n\n\n<p><code>@ExceptionHandler<\/code>&nbsp;\u6ce8\u89e3\u901a\u5e38\u7528\u5728\u63a7\u5236\u5668\u7c7b\u4e2d\uff0c\u6216\u8005\u7528\u5728\u63a7\u5236\u5668\u7c7b\u7684\u7236\u7c7b\u4e2d\uff0c\u4ee5\u4fbf\u96c6\u4e2d\u5904\u7406\u5f02\u5e38\u3002\u4f7f\u7528\u8fd9\u4e2a\u6ce8\u89e3\u53ef\u4ee5\u8ba9\u4f60\u7684\u5f02\u5e38\u5904\u7406\u903b\u8f91\u66f4\u52a0\u6e05\u6670\u548c\u96c6\u4e2d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import org.springframework.web.bind.annotation.ControllerAdvice;\nimport org.springframework.web.bind.annotation.ExceptionHandler;\nimport org.springframework.web.bind.annotation.ResponseBody;\nimport org.springframework.http.ResponseEntity;\n\n@ControllerAdvice\npublic class GlobalExceptionHandler {\n\n     @ExceptionHandler(value = Exception.class)\n     @ResponseBody\n     public ResponseEntity&lt;Object&gt; handleException(Exception e) {\n         \/\/ \u81ea\u5b9a\u4e49\u5f02\u5e38\u5904\u7406\u903b\u8f91\n         return ResponseEntity.status(500).body(\"An error occurred: \" + e.getMessage());\n     }\n}\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0cGlobalExceptionHandler \u7c7b\u4f7f\u7528\u4e86 @ControllerAdvice \u6ce8\u89e3\uff0c\u8868\u660e\u5b83\u662f\u4e00\u4e2a\u5168\u5c40\u5f02\u5e38\u5904\u7406\u5668\u3002@ExceptionHandler \u6ce8\u89e3\u7528\u4e8e\u6307\u5b9a\u8fd9\u4e2a\u65b9\u6cd5\u8981\u5904\u7406\u7684\u5f02\u5e38\u7c7b\u578b\uff0c\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u662f Exception \u7c7b\u578b\u7684\u6240\u6709\u5f02\u5e38\u3002\n\n\u5f53\u63a7\u5236\u5668\u4e2d\u629b\u51fa\u5f02\u5e38\u65f6\uff0cSpring\u6846\u67b6\u4f1a\u81ea\u52a8\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u5e76\u5c06\u5f02\u5e38\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u5b83\u3002\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2d\u5b9a\u4e49\u5982\u4f55\u5904\u7406\u8fd9\u4e2a\u5f02\u5e38\uff0c\u6bd4\u5982\u8bb0\u5f55\u65e5\u5fd7\u3001\u8fd4\u56de\u9519\u8bef\u4fe1\u606f\u7ed9\u5ba2\u6237\u7aef\u7b49\u3002\n\n@ExceptionHandler \u6ce8\u89e3\u4f7f\u5f97\u5f02\u5e38\u5904\u7406\u66f4\u52a0\u7075\u6d3b\u548c\u5f3a\u5927\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u4e3a\u4e0d\u540c\u7684\u5f02\u5e38\u7c7b\u578b\u63d0\u4f9b\u4e0d\u540c\u7684\u5904\u7406\u903b\u8f91\uff0c\u4ece\u800c\u63d0\u9ad8\u5e94\u7528\u7684\u5065\u58ee\u6027\u548c\u7528\u6237\u4f53\u9a8c\u3002<\/code><\/pre>\n\n\n\n<p><\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>@Builder<\/summary>\n<p><code>@Builder<\/code>&nbsp;\u662f Lombok \u5e93\u63d0\u4f9b\u7684\u4e00\u4e2a\u6ce8\u89e3\uff0c\u7528\u4e8e\u7b80\u5316\u5bf9\u8c61\u7684\u6784\u5efa\u8fc7\u7a0b\u3002\u901a\u8fc7\u4f7f\u7528&nbsp;<code>@Builder<\/code>&nbsp;\u6ce8\u89e3\uff0c\u53ef\u4ee5\u751f\u6210\u4e00\u4e2a\u9759\u6001\u5185\u90e8\u7c7b&nbsp;<code>Builder<\/code>\uff0c\u8fd9\u4e2a\u7c7b\u63d0\u4f9b\u4e86\u4e00\u79cd\u94fe\u5f0f\u8c03\u7528\u7684\u65b9\u5f0f\u6765\u521b\u5efa\u548c\u521d\u59cb\u5316\u5bf9\u8c61\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u7528\u573a\u666f<\/h3>\n\n\n\n<p><code>@Builder<\/code>&nbsp;\u6ce8\u89e3\u7279\u522b\u9002\u7528\u4e8e\u90a3\u4e9b\u5177\u6709\u591a\u4e2a\u5c5e\u6027\u7684\u7c7b\uff0c\u5c24\u5176\u662f\u5f53\u8fd9\u4e9b\u5c5e\u6027\u7ecf\u5e38\u9700\u8981\u4ee5\u4e0d\u540c\u7684\u7ec4\u5408\u6765\u521b\u5efa\u5bf9\u8c61\u65f6\u3002\u4f7f\u7528&nbsp;<code>@Builder<\/code>&nbsp;\u53ef\u4ee5\u907f\u514d\u7f16\u5199\u5197\u957f\u7684\u6784\u9020\u51fd\u6570\u6216\u590d\u6742\u7684\u5de5\u5382\u65b9\u6cd5\uff0c\u4f7f\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u548c\u6613\u4e8e\u7ef4\u62a4\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b<\/h3>\n\n\n\n<p>\u5047\u8bbe\u6709\u4e00\u4e2a&nbsp;<code>User<\/code>&nbsp;\u7c7b\uff0c\u6211\u4eec\u5e0c\u671b\u4f7f\u7528&nbsp;<code>@Builder<\/code>&nbsp;\u6ce8\u89e3\u6765\u7b80\u5316\u5176\u5bf9\u8c61\u7684\u521b\u5efa\u8fc7\u7a0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import lombok.Builder;\nimport lombok.Getter;\nimport lombok.Setter;\n\n@Getter\n@Setter\npublic class User {\n    private String name;\n    private int age;\n    private String email;\n\n    @Builder\n     public User(String name, int age, String email) {\n         this.name = name;\n         this.age = age;\n         this.email = email;\n     }\n}<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>@Builder<\/code>&nbsp;\u6ce8\u89e3\u88ab\u6dfb\u52a0\u5230&nbsp;<code>User<\/code>&nbsp;\u7c7b\u4e0a\u3002Lombok \u4f1a\u81ea\u52a8\u751f\u6210\u4e00\u4e2a&nbsp;<code>UserBuilder<\/code>&nbsp;\u7c7b\uff0c\u5141\u8bb8\u6211\u4eec\u4ee5\u94fe\u5f0f\u8c03\u7528\u7684\u65b9\u5f0f\u521b\u5efa&nbsp;<code>User<\/code>&nbsp;\u5bf9\u8c61\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>User user = User.builder()\n                .name(\"John Doe\")\n                .age(30)\n                .email(\"john.doe@example.com\")\n                .build();<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u4e8b\u9879<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528&nbsp;<code>@Builder<\/code>&nbsp;\u6ce8\u89e3\u65f6\uff0cLombok \u4f1a\u751f\u6210\u4e00\u4e2a&nbsp;<code>Builder<\/code>&nbsp;\u7c7b\uff0c\u8be5\u7c7b\u5305\u542b\u4e0e\u539f\u7c7b\u540c\u540d\u7684\u9759\u6001\u65b9\u6cd5&nbsp;<code>builder()<\/code>\uff0c\u4ee5\u53ca\u4e0e\u539f\u7c7b\u5c5e\u6027\u540c\u540d\u7684&nbsp;<code>setter<\/code>&nbsp;\u65b9\u6cd5\u3002<\/li>\n\n\n\n<li><code>@Builder<\/code>&nbsp;\u6ce8\u89e3\u53ef\u4ee5\u4e0e&nbsp;<code>@Data<\/code>\u3001<code>@Getter<\/code>\u3001<code>@Setter<\/code>&nbsp;\u7b49\u5176\u4ed6 Lombok \u6ce8\u89e3\u4e00\u8d77\u4f7f\u7528\uff0c\u4ee5\u63d0\u4f9b\u5b8c\u6574\u7684\u5bf9\u8c61\u6784\u5efa\u548c\u8bbf\u95ee\u63a7\u5236\u529f\u80fd\u3002<\/li>\n\n\n\n<li><code>@Builder<\/code>&nbsp;\u6ce8\u89e3\u751f\u6210\u7684&nbsp;<code>Builder<\/code>&nbsp;\u7c7b\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u53ef\u4ee5\u7528\u4e8e\u5e76\u53d1\u73af\u5883\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u8fc7\u4f7f\u7528&nbsp;<code>@Builder<\/code>&nbsp;\u6ce8\u89e3\uff0c\u53ef\u4ee5\u6781\u5927\u5730\u7b80\u5316\u590d\u6742\u5bf9\u8c61\u7684\u521b\u5efa\u8fc7\u7a0b\uff0c\u4f7f\u4ee3\u7801\u66f4\u52a0\u6e05\u6670\u548c\u6613\u4e8e\u7406\u89e3\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-47.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"405\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-47.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-164\"  sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/div><\/figure>\n\n\n\n<p>Builder\u662f\u4e00\u4e2a\u6784\u5efa\u5668<\/p>\n<\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary><\/summary><\/details>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u5143\u6ce8\u89e3<\/summary>\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-53-1024x578.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"578\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/08\/image-53-1024x578.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-184\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Target(ElementType.METHOD)\/\/\u8868\u793a\u53ea\u80fd\u52a0\u5728\u65b9\u6cd5\u4e0a\n@Retention(RetentionPolicy.RUNTIME)\/\/\u8868\u660e\u8be5\u6ce8\u89e3\u5728\u8fd0\u884c\u65f6\u4e5f\u80fd\u88ab\u8bc6\u522b\u5230\n\/\/@ AutoFill\u6ce8\u89e3\u88ab\u6807\u8bb0\u4e3a @Retention(RetentionPolicy.RUNTIME)\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u88ab\u8bbf\u95ee\u3002\npublic @interface AutoFill {\n    \/\/\u6570\u636e\u5e93\u64cd\u4f5c\u7c7b\u578b,INSERT\n    OperationType value();\n\/\/Target \u8868\u793a\u6211\u4eec\u7684\u6ce8\u89e3\u53ef\u4ee5\u7528\u5728\u54ea\u4e9b\u5730\u65b9\n\/\/Retenton \u8868\u793a\u6211\u4eec\u7684\u6ce8\u89e3\u5728\u4ec0\u4e48\u65f6\u5019\u6709\u6548\nruntime>class>sources\n\/\/Documented  \u8868\u793a\u662f\u5426\u5c06\u6211\u4eec\u7684\u6ce8\u89e3\u751f\u6210\u5728JAVAdoc\u5f53\u4e2d\n\/\/Inherited\u8868\u793a\u5b50\u7c7b\u53ef\u4ee5\u7ee7\u627f\u7236\u7c7b\u5f53\u4e2d\u7684\u6ce8\u89e3\n    \n<\/code><\/pre>\n<\/details>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-4"],"_links":{"self":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":7,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"predecessor-version":[{"id":187,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/34\/revisions\/187"}],"wp:attachment":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}