{"id":10803,"date":"2023-04-19T21:39:19","date_gmt":"2023-04-19T13:39:19","guid":{"rendered":"http:\/\/123.57.164.21\/?p=10803"},"modified":"2023-04-19T21:40:01","modified_gmt":"2023-04-19T13:40:01","slug":"api%e8%a7%84%e8%8c%83%e7%ba%a6%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=10803","title":{"rendered":"API\u89c4\u8303\u7ea6\u5b9a"},"content":{"rendered":"\n<p>\u4e3a\u4e86\u9ad8\u6548\u5f00\u53d1\uff0c\u8282\u7ea6\u7f16\u5199\u6587\u6863\u7684\u6210\u672c\uff0cAPI\u670d\u52a1\u4f7f\u7528Swagger\u6765\u63cf\u8ff0<\/p>\n\n\n\n<p><strong>\u4e00\u3001API\u8bbe\u8ba1\u539f\u5219<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<ul><li>\u63a7\u5236API\u7684\u7c92\u5ea6\u548c\u6570\u91cf<\/li><li>\u547d\u540d\u8981\u9075\u5faa\u7b80\u5355\u3001\u53ef\u8bfb\u3001\u7edf\u4e00\u539f\u5219\uff1b<\/li><li>\u4f18\u5148\u8bbe\u8ba1API\uff0c\u7136\u540e\u7f16\u7801<\/li><\/ul>\n\n\n\n<p><strong>\u4e8c\u3001URL\u8bbe\u8ba1\u3010\u9488\u5bf9\u540e\u7aef\u5f00\u53d1\u3011<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>2.1 HTTP\u89c4\u8303<\/strong><\/p>\n\n\n\n<p>\u52a8\u8bcd\u76ee\u524d\u6682\u65f6\u4ee5\u4e0b\u9762\u4e24\u79cd HTTP \u65b9\u6cd5\uff0c\u5bf9\u5e94 CRUD \u64cd\u4f5c\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">GET\uff1a\u8bfb\u53d6\uff08Read\uff09\nPOST\uff1a\u65b0\u5efa\uff08Create,Update,Delete\uff09\nPUT\uff1a\u66f4\u65b0\uff08Update\uff09\nPATCH\uff1a\u66f4\u65b0\uff08Update\uff09\uff0c\u901a\u5e38\u662f\u90e8\u5206\u66f4\u65b0\nDELETE\uff1a\u5220\u9664\uff08Delete\uff09<\/pre>\n\n\n\n<p><strong>2.2 \u547d\u540d\u89c4\u8303<\/strong><\/p>\n\n\n\n<ul><li>\u7b80\u6d01<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-237.png\" alt=\"\" class=\"wp-image-10804\" width=\"278\" height=\"172\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-237.png 560w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-237-300x185.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-237-230x142.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-237-350x216.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-237-480x297.png 480w\" sizes=\"(max-width: 278px) 100vw, 278px\" \/><\/figure><\/div>\n\n\n\n<ul><li>\u53ef\u8bfb<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-238.png\" alt=\"\" class=\"wp-image-10805\" width=\"287\" height=\"219\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-238.png 550w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-238-300x229.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-238-230x176.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-238-350x267.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-238-480x367.png 480w\" sizes=\"(max-width: 287px) 100vw, 287px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2.3 API\u81c3\u80bf<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-239-1024x237.png\" alt=\"\" class=\"wp-image-10806\" width=\"508\" height=\"117\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-1024x237.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-300x69.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-768x178.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-830x192.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-230x53.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-350x81.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239-480x111.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-239.png 1194w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-240.png\" alt=\"\" class=\"wp-image-10807\" width=\"307\" height=\"299\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-240.png 568w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-240-300x293.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-240-230x224.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-240-350x341.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-240-480x468.png 480w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2.4 \u8fd4\u56de\u503c\u89c4\u8303<\/strong><\/p>\n\n\n\n<ul><li>\u7981\u6b62\u8fd4\u56de\u65e0\u6548\u7684\u5b57\u6bb5\uff0c\u7ed9\u524d\u7aef\u4eba\u5458\u589e\u52a0\u8054\u8c03\u7684\u6c9f\u901a\u6210\u672c\u7684\u540c\u65f6\u66b4\u9732\u5e95\u5c42\u4fe1\u606f\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-241.png\" alt=\"\" class=\"wp-image-10808\" width=\"361\" height=\"228\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-241.png 712w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-241-300x190.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-241-230x145.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-241-350x221.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-241-480x303.png 480w\" sizes=\"(max-width: 361px) 100vw, 361px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2.5 API\u63a5\u53e3\u6ce8\u91ca\u89c4\u8303<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-242.png\" alt=\"\" class=\"wp-image-10809\" width=\"409\" height=\"289\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-242.png 770w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-242-300x212.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-242-768x543.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-242-230x162.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-242-350x247.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-242-480x339.png 480w\" sizes=\"(max-width: 409px) 100vw, 409px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u4e09\u3001HTTP\u72b6\u6001\u7801<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>3.1 \u5e38\u7528\u72b6\u6001\u7801<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">2xx\uff1a\u64cd\u4f5c\u6210\u529f\n4xx\uff1a\u5ba2\u6237\u7aef\u9519\u8bef\n5xx\uff1a\u670d\u52a1\u5668\u9519\u8bef<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">2xx \u72b6\u6001\u7801\n200\u8bf7\u6c42(\u6216\u5904\u7406)\u6210\u529f\n201\u8bf7\u6c42(\u6216\u5904\u7406)\u5931\u8d25\n \n4xx \u72b6\u6001\u7801\n400 Bad Request\uff1a\u8bf7\u6c42\u53c2\u6570\u4e0d\u5b8c\u6574\u6216\u4e0d\u6b63\u786e\u3002\n401 Unauthorized\uff1a\u672a\u6388\u6743\u6807\u8bc6\u3002\n403 Forbidden\uff1a\u7528\u6237\u901a\u8fc7\u4e86\u8eab\u4efd\u9a8c\u8bc1\uff0c\u4f46\u662f\u4e0d\u5177\u6709\u8bbf\u95ee\u8d44\u6e90\u6240\u9700\u7684\u6743\u9650\u3002\n404 Not Found\uff1a\u6240\u8bf7\u6c42\u7684\u8d44\u6e90\u4e0d\u5b58\u5728\uff0c\u6216\u4e0d\u53ef\u7528\u3002\n405 Method Not Allowed\uff1a\u7528\u6237\u5df2\u7ecf\u901a\u8fc7\u8eab\u4efd\u9a8c\u8bc1\uff0c\u4f46\u662f\u6240\u7528\u7684 HTTP \u65b9\u6cd5\u4e0d\u5728\u4ed6\u7684\u6743\u9650\u4e4b\u5185\u3002\n410 Gone\uff1a\u6240\u8bf7\u6c42\u7684\u8d44\u6e90\u5df2\u4ece\u8fd9\u4e2a\u5730\u5740\u8f6c\u79fb\uff0c\u4e0d\u518d\u53ef\u7528\u3002\n415 Unsupported Media Type\uff1a\u5ba2\u6237\u7aef\u8981\u6c42\u7684\u8fd4\u56de\u683c\u5f0f\u4e0d\u652f\u6301\u3002\u6bd4\u5982\uff0cAPI \u53ea\u80fd\u8fd4\u56de JSON \u683c\u5f0f\uff0c\u4f46\u662f\u5ba2\u6237\u7aef\u8981\u6c42\u8fd4\u56de XML \u683c\u5f0f\u3002\n422 Unprocessable Entity \uff1a\u5ba2\u6237\u7aef\u4e0a\u4f20\u7684\u9644\u4ef6\u65e0\u6cd5\u5904\u7406\uff0c\u5bfc\u81f4\u8bf7\u6c42\u5931\u8d25\u3002\n429 Too Many Requests\uff1a\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u6b21\u6570\u8d85\u8fc7\u9650\u989d\u3002\n \n5xx \u72b6\u6001\u7801\n\u4e00\u822c\u6765\u8bf4\uff0cAPI \u4e0d\u4f1a\u5411\u7528\u6237\u900f\u9732\u670d\u52a1\u5668\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u6240\u4ee5\u53ea\u8981\u4e24\u4e2a\u72b6\u6001\u7801\u5c31\u591f\u4e86\u3002\n500 Internal Server Error\uff1a\u5ba2\u6237\u7aef\u8bf7\u6c42\u6709\u6548\uff0c\u670d\u52a1\u5668\u5904\u7406\u65f6\u53d1\u751f\u4e86\u610f\u5916\u3002\n503 Service Unavailable\uff1a\u670d\u52a1\u5668\u65e0\u6cd5\u5904\u7406\u8bf7\u6c42\uff0c\u4e00\u822c\u7528\u4e8e\u7f51\u7ad9\u7ef4\u62a4\u72b6\u6001\u3002<\/pre>\n\n\n\n<p><strong>\u56db\u3001API\u8fd4\u56de\u683c\u5f0f\u89c4\u8303<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>4.1API \u7684\u8bf7\u6c42\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/{\u57df\u540d}\/v1\/{\u6a21\u5757}\/{\u52a8\u4f5c}\n\u57df\u540d\uff1ahttps:\/\/localhost:5011 \u6216\u8005 http:\/\/localhost:5010 \u6216\u8005 https:\/\/api.stonecontact.com\n\u6a21\u5757: controller\u540d\u79f0\uff0c\u6bd4\u5982user\u3002\n\u52a8\u4f5c: \u6bcf\u4e2a\u6a21\u5757\u6240\u5b9e\u73b0\u7684\u529f\u80fd.\u3002\u6bd4\u5982: add\uff0cdelete \u7b49.\n  \n\u524d\u7aef\u7ec4\u4ef6\u5177\u4f53\u683c\u5f0f\u4ee5\u997f\u4e86\u4e48\u5b98\u7f51\u7684\u7ec4\u4ef6\u4e3a\u89c4\u8303\uff0c\n\u6587\u6863\u63cf\u8ff0\u8be6\u89c1Swagger\n\u670d\u52a1\u5668\u8fd4\u56de\u72b6\u6001\u7801\u4ee5.NET Core\u7684HttpStatusCode\u5bf9\u8c61\u4e3a\u4e3b\uff0c\u4e0d\u591f\u7684\u53ef\u4ee5\u8fdb\u884c\u6269\u5c55\u3000\n<\/pre>\n\n\n\n<p><strong>4.2API \u8fd4\u56de\u683c\u5f0f<\/strong><\/p>\n\n\n\n<p>\u54cd\u5e94\u4e00\u7ea7\u76ee\u5f55\u5305\u542b\u4e09\u4e2a\u5b57\u6bb5\u5982\u4e0b\u6240\u793a\uff1acode\uff0cmessage\uff0cdata<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n \"code\": 200,\n \"message\": \"\", \n \"data\":    \n}<\/pre>\n\n\n\n<p><strong>4.2.1 \u670d\u52a1\u5668\u5f02\u5e38\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n \"code\": 500,\n \"message\": \"\u5185\u90e8\u8bf7\u6c42\u51fa\u9519\uff01\",\n \"data\": 0\n}<\/pre>\n\n\n\n<p><strong>4.2.2 \u9a8c\u8bc1\u8fd4\u56de\u9519\u8bef\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"code\": 400,\n    \"message\": \"Validation errors\",\n    \"data\": [\n        \"'Color Name' \u4e0d\u80fd\u4e3a\u7a7a\u3002\",\n        \"ColorName is mandatory.(Length:0-50)\",\n        \"'Color Name_ CN' \u4e0d\u80fd\u4e3a\u7a7a\u3002\"\n    ]\n}<\/pre>\n\n\n\n<p><strong>4.2.3 \u5217\u8868\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n  \"code\": 200,\n  \"message\": \"Operation success.\",\n  \"data\": {\n    \"grid\": [\n      {\n        \"colorID\": 5,\n        \"colorName\": \"White\",\n        \"pri\": 0,\n        \"updateTimeTag\": \"2019-07-11T01:11:12.8490797Z\",\n        \"colorName_CN\": \"\u767d\u8272\"\n      },\n      {\n        \"colorID\": 6,\n        \"colorName\": \"Red\",\n        \"pri\": 0,\n        \"updateTimeTag\": \"2019-07-11T01:11:12.8496838Z\",\n        \"colorName_CN\": \"\u7ea2\u8272\"\n      },\n      {\n        \"colorID\": 7,\n        \"colorName\": \"Multicolor\",\n        \"pri\": 0,\n        \"updateTimeTag\": \"2019-07-11T01:11:12.8496915Z\",\n        \"colorName_CN\": \"\u6df7\u5408\"\n      }\n    ],\n    \"recordCount\": 19\n  }\n}<\/pre>\n\n\n\n<p><strong>4.2.4 \u6743\u9650\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n \"code\": 401,\n}<\/pre>\n\n\n\n<p><strong>4.2.5 \u8fd4\u56de\u5355\u4e2a\u5bf9\u8c61<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"code\": 200,\n    \"message\": \"Operation success.\",\n    \"data\": {\n        \"colorID\": 4,\n        \"colorName\": \"Brown\",\n        \"pri\": 0,\n        \"updateTimeTag\": \"2019-07-11T01:06:20.0629948Z\",\n        \"colorName_CN\": \"\u68d5\u8272\"\n    }\n}<\/pre>\n\n\n\n<p><strong>4.2.6 \u6811Tree\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n  \"code\": 200,\n  \"message\": \"Operation success.\",\n  \"data\": [\n    {\n      \"id\": 365,\n      \"text\": \"Stone Blocks\",\n      \"pid\": 0,\n      \"expanded\": true,\n      \"leaf\": true,\n      \"children\": [\n        {\n          \"id\": 366,\n          \"text\": \"Marble Blocks\",\n          \"pid\": 365,\n          \"expanded\": true,\n          \"leaf\": false,\n          \"children\": null\n        },\n        {\n          \"id\": 367,\n          \"text\": \"Granite Blocks\",\n          \"pid\": 365,\n          \"expanded\": true,\n          \"leaf\": false,\n          \"children\": null\n        }\n      ]\n    },\n    {\n      \"id\": 172,\n      \"text\": \"Stone Tiles &amp; Slabs\",\n      \"pid\": 0,\n      \"expanded\": true,\n      \"leaf\": true,\n      \"children\": [\n        {\n          \"id\": 173,\n          \"text\": \"Alabaster Tiles &amp; Slabs\",\n          \"pid\": 172,\n          \"expanded\": true,\n          \"leaf\": false,\n          \"children\": null\n        },\n        {\n          \"id\": 174,\n          \"text\": \"BlueStone Tiles &amp; Slabs\",\n          \"pid\": 172,\n          \"expanded\": true,\n          \"leaf\": false,\n          \"children\": null\n        }\n      ]\n    }\n  ]\n}<\/pre>\n\n\n\n<p><strong>4.2.7 \u8fd4\u56deDropDownList\u683c\u5f0f<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"code\":200,\n    \"msg\":\"\u6210\u529f\",\n    \"data\":[\n        {\n            \"text\":\"China\",\n            \"value\":\"0\"\n        },\n        {\n            \"text\":\"America\",\n            \"value\":\"1\"\n        },\n        {\n            \"text\":\"Canada\",\n            \"value\":\"3\"\n        }\n    ],<\/pre>\n\n\n\n<p><strong>5.3API \u8fd4\u56de\u7801<\/strong><\/p>\n\n\n\n<p>API \u8fd4\u56de\u7801\u5982\u4e0b:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/04\/image-243-1024x301.png\" alt=\"\" class=\"wp-image-10810\" width=\"510\" height=\"149\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-1024x301.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-300x88.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-768x225.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-830x244.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-230x67.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-350x103.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243-480x141.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/04\/image-243.png 1254w\" sizes=\"(max-width: 510px) 100vw, 510px\" \/><\/figure><\/div>\n\n\n\n<p><strong>5.4\u5185\u90e8\u670d\u52a1\u8c03\u7528\u63a5\u53e3<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/1.Get\u8c03\u7528\u65b9\u6cd5\n\/\/1.1\u5e26\u53c2\u6570\n\/\/Dictionary&lt;string, object> param = new Dictionary&lt;string, object>();\n\/\/param.Add(\"PageSize\", 20);\n\/\/param.Add(\"PageIndex\", 5);\n\/\/var client = RestSharpHelper.GetClient(\"url\");\n\/\/var data = client.SendRequest(RestSharp.Method.GET, param);\n \n\/\/1.2\u4e0d\u5e26\u53c2\u6570\nvar client = RestSharpHelper.GetClient(\"http:\/\/localhost:5010\/api\/v1\/SysColor\/list\");\nvar response = client.SendRequest(Method.GET);\nif (response.StatusCode == HttpStatusCode.OK)\n{\n    var result = JsonConvert.DeserializeObject&lt;ColorResult>(response.Data.Data);\n}\n \n\/\/2.Post\u8c03\u7528\u65b9\u6cd5\nvar client2 = RestSharpHelper.GetClient(\"http:\/\/localhost:5010\/api\/v1\/SysColor\/list\");\nvar response2 = client2.SendRequest(Method.POST, JsonConvert.SerializeObject(new PostModel() { }));\n \nif (response2.StatusCode == HttpStatusCode.OK)\n{\n    var result2 = JsonConvert.DeserializeObject&lt;ColorResult>(response2.Data.Data);\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4e86\u9ad8\u6548\u5f00\u53d1\uff0c\u8282\u7ea6\u7f16\u5199\u6587\u6863\u7684\u6210\u672c\uff0cAPI\u670d\u52a1\u4f7f\u7528Swagger\u6765\u63cf\u8ff0 \u4e00\u3001API\u8bbe\u8ba1\u539f\u5219 \u63a7\u5236API\u7684\u7c92\u5ea6\u548c\u6570 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10803"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10803"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10803\/revisions"}],"predecessor-version":[{"id":10812,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10803\/revisions\/10812"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}