{"id":194652,"date":"2020-11-01T15:29:07","date_gmt":"2020-11-01T07:29:07","guid":{"rendered":"http:\/\/4563.org\/?p=194652"},"modified":"2020-11-01T15:29:07","modified_gmt":"2020-11-01T07:29:07","slug":"%e5%b7%a5%e4%bd%9c%e6%b5%81-%e4%b8%8e%e4%b8%9a%e5%8a%a1%e6%95%b0%e6%8d%ae%e6%b5%81%e6%80%8e%e4%b9%88%e8%a7%a3%e8%80%a6%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=194652","title":{"rendered":"\u5de5\u4f5c\u6d41 \u4e0e\u4e1a\u52a1\u6570\u636e\u6d41\u600e\u4e48\u89e3\u8026\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5de5\u4f5c\u6d41 \u4e0e\u4e1a\u52a1\u6570\u636e\u6d41\u600e\u4e48\u89e3\u8026\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shade <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e1a\u52a1\u9700\u8981\u5b9e\u65f6\u6c47\u603b\u4e1a\u52a1\u5904\u7406\u8fc7\u7a0b\u4e2d\u4f1a\u7b7e\u4eba\u5458\u7684\u5904\u7406\u53cd\u9988\u4fe1\u606f\uff0c\u76f4\u63a5\u5728\u4efb\u52a1\u76d1\u542c\u5668\u91cc\u9762\u5904\u7406\u6d41\u7a0b\u53d8\u91cf\u53c8\u4e0d\u80fd\u5f88\u597d\u5730\u5e94\u5bf9\u4e1a\u52a1\u6d41\u7a0b\u7684\u53d8\u5316\uff0c\u76ee\u524d\u80fd\u60f3\u5230\u7684\u662f\u901a\u8fc7 redis \u548c kafka \u961f\u5217\u63a5\u6536\u4e8b\u4ef6\u540e\u8fdb\u884c\u7edf\u4e00\u5904\u7406\u3002<\/p>\n<p>\u4e0d\u77e5\u9053\u8fd8\u6709\u6ca1\u6709\u6bd4\u8f83\u597d\u4e00\u70b9\u7684\u65b9\u6848\u80fd\u591f\u8fdb\u884c\u5de5\u4f5c\u6d41\u4e0e\u4e1a\u52a1\u6570\u636e\u6d41\u7684\u89e3\u8026\uff0c\u89e3\u51b3\u4ee5\u4e0b\u4e24\u4e2a\u95ee\u9898\uff1a<br \/> 1.\u52a8\u6001\u6d41\u7a0b\u8868\u5355\u80fd\u53cd\u5411\u6620\u5c04\u5230\u4e1a\u52a1\u6570\u636e\u5b9e\u4f53<br \/> 2.\u4e1a\u52a1\u6570\u636e\u6d41\u548c\u5de5\u4f5c\u6d41\u9694\u79bb\u540e\u53ef\u52a8\u6001\u53cd\u5411\u914d\u7f6e\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4219418\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lecher <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5c31\u662f\u4e00\u4efd\u6570\u636e\uff0c\u6570\u636e\u5b9e\u4f53\u540c\u65f6\u8bb0\u5f55\u5de5\u4f5c\u6d41\u72b6\u6001\uff0c\u4e1a\u52a1\u5904\u7406\u7684\u6d41\u7a0b\u540c\u65f6\u4fee\u6539\u5b9e\u4f53\u5bf9\u5e94\u7684\u6570\u636e\u5e76\u63d0\u4ea4\u5230\u6570\u636e\u5e93\u3002<\/p>\n<p>\u6700\u76f4\u767d\u7684\u5de5\u4f5c\u6d41\u63cf\u8ff0\u65b9\u5f0f\u7c7b\u4f3c\u8fd9\u6837<br \/>\u72b6\u6001 1: \u54cd\u5e94\u4e8b\u4ef6 a,b,c<br \/>\u72b6\u6001 2: \u54cd\u5e94\u4e8b\u4ef6 d,e,f<br \/>\u72b6\u6001 3: \u7ed3\u675f<br \/>\u5904\u7406\u7684\u8fc7\u7a0b\u65e0\u975e\u662f\uff0c\u6536\u5230\u5bf9 entity1 \u53d1\u9001\u7684\u4e8b\u4ef6 x\uff0c\u4ece\u6570\u636e\u5e93\u4e2d\u5c06 entity1 \u67e5\u8be2\u51fa\u6765\uff0c\u8fdb\u884c\u72b6\u6001\u4e8b\u4ef6\u8868\u67e5\u8be2\uff0c\u8df3\u8f6c\u5230\u8981\u6267\u884c\u7684\u4e1a\u52a1\u5904\u7406\u4ee3\u7801\uff0c\u7136\u540e\u670d\u52a1\u6267\u884c\u8fd9\u4efd\u4ee3\u7801\u5bf9 entity1 \u7684\u6570\u636e\u505a\u5904\u7406\uff0c\u5904\u7406\u5b8c\u540e\u8df3\u8f6c\u5230\u72b6\u6001 y \u5e76\u63d0\u4ea4\u5f53\u524d entity1 \u7ecf\u8fc7\u5904\u7406\u540e\u7684\u6570\u636e\u5230\u6570\u636e\u5e93\uff0c\u7b49\u5f85\u4e0b\u4e00\u4e2a\u4e8b\u4ef6\u3002<\/p>\n<p>\u63a5\u7740\u62c6\u89e3\u4e00\u4e0b\u4e8b\u4ef6\u7684\u7c7b\u578b\uff1a<br \/>1.\u5916\u90e8\u670d\u52a1\u53d1\u9001\u8fc7\u6765\u7684\u8bf7\u6c42<br \/>2.\u5176\u5b83\u5de5\u4f5c\u6d41\u53d1\u9001\u8fc7\u6765\u7684\u4e8b\u4ef6<br \/>3.\u5ef6\u65f6 \/\u5b9a\u65f6\u89e6\u53d1\u7684\u4e8b\u4ef6<\/p>\n<p>\u53ef\u4ee5\u770b\u51fa\u6765\uff0c\u9700\u8981\u6709\u4e0d\u540c\u7684\u534f\u8bae\u6765\u9002\u914d\u5bf9\u5e94\u7684\u4e8b\u4ef6\u8f6c\u6362\uff1a<br \/>1.\u63d0\u4f9b\u670d\u52a1\u7aef\u5bf9\u5916\u63a5\u53e3\u63a5\u6536\u5916\u90e8\u8bf7\u6c42\uff0c\u5e76\u8f6c\u6362\u6210\u4e8b\u4ef6<br \/>2.\u4e0d\u505a\u8f6c\u6362<br \/>3.\u63d0\u4f9b\u5ef6\u65f6\u961f\u5217\u670d\u52a1\u6536\u53d1\u5ef6\u65f6\u4efb\u52a1\uff0c\u5e76\u5728\u6307\u5b9a\u65f6\u95f4\u53d1\u8d77\u5bf9\u5e94\u7684\u4e8b\u4ef6<\/p>\n<p>\u518d\u770b\u4e00\u4e0b\u6536\u5230\u4e8b\u4ef6\u8be5\u600e\u4e48\u5904\u7406\uff1a<br \/>1. \u6839\u636e\u4e8b\u4ef6\u53c2\u6570\u4e2d\u7684 entityName, entityID \u67e5\u51fa\u6570\u636e<br \/>2. \u5c06\u6570\u636e loaded \u5230 class \u4e2d<br \/>3. \u8c03\u7528\u4e8b\u4ef6\u5bf9\u5e94\u7684 method\uff0c\u6267\u884c\u5bf9\u5e94\u7684\u4e1a\u52a1\u4ee3\u7801<br \/>4. method \u4e4b\u540e\u9700\u8981\u66f4\u65b0\u4e0b\u4e00\u9636\u6bb5\u7684\u72b6\u6001\u6807\u8bc6\u5230 class \u7684\u5b57\u6bb5\u4e0a<br \/>5. \u5c06\u5f53\u524d entity \u7684\u6240\u6709\u4e1a\u52a1\u6570\u636e\u8fde\u540c\u72b6\u6001\u6807\u8bc6\u4e00\u5e76\u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4fdd\u5b58<\/p>\n<p>\u53ef\u4ee5\u63a8\u6d4b\u4e00\u4e0b\u5b9e\u73b0\u65b9\u5f0f\uff1a<br \/>1.\u4ece\u6570\u636e\u5e93 load \u6570\u636e\u51fa\u6765<br \/>2.\u4f7f\u7528\u8fd9\u4efd\u6570\u636e\u53bb new \u4e00\u4e2a class<br \/>3.\u5e26\u7740\u4e8b\u4ef6\u53c2\u6570\u53bb call class.method(params)<br \/>4.\u5e8f\u5217\u5316 class \u7684\u6570\u636e\uff0c\u63d0\u4ea4\u5230\u6570\u636e\u5e93<\/p>\n<p>\u8fd9\u9700\u8981\u8fd0\u884c\u7684\u8bed\u8a00\u652f\u6301\u4ec0\u4e48\u7279\u6027\uff1f<br \/>1. \u53ef\u4ee5\u6839\u636e\u5b57\u7b26\u4e32\u7c7b\u540d\u5b9e\u4f8b\u5316\u4e00\u4e2a class<br \/>2. \u53ef\u4ee5\u6839\u636e\u5b57\u7b26\u4e32\u65b9\u6cd5\u540d\u8c03\u7528\u4e00\u4e2a class.method<br \/>3. \u65b9\u4fbf\u7684\u5e8f\u5217\u5316\u3001\u53cd\u5e8f\u5217\u5316\u6570\u636e\uff0c\u6700\u597d\u662f\u65e0\u7f1d\u4e0e json \u5f62\u5f0f\u7684\u6570\u636e\u8f6c\u6362<br \/>4. \u80fd\u7528\u7b80\u6d01\u7684\u8bed\u6cd5\u63cf\u8ff0\u4e1a\u52a1\u5904\u7406<\/p>\n<p>\u4e0d\u7ba1\u539f\u59cb\u4e1a\u52a1\u662f\u7528\u4ec0\u4e48\u8bed\u8a00\u5199\u7684\uff0c\u8fd9\u4e9b\u4e1a\u52a1\u5904\u7406\u4ee3\u7801\u90fd\u53ef\u4ee5\u5728\u540c\u4e00\u5957\u670d\u52a1\u8fdb\u7a0b\u5185\u8fd0\u884c\uff0c\u56e0\u4e3a\u672c\u8d28\u4e0a\u8fd9\u5c31\u662f\u4e00\u4e2a\u8bf7\u6c42-\u5904\u7406-\u4fdd\u5b58\u6570\u636e-\u8fd4\u56de\u7ed3\u679c\u7684\u6d41\u7a0b\u3002\u4e1a\u52a1\u4ee3\u7801\u4e0e\u6b63\u5e38\u7684\u7f51\u7edc\u8bf7\u6c42\u5904\u7406\u6beb\u65e0\u5dee\u522b\u3002<\/p>\n<p>\u63a5\u7740\u629b\u5f00\u5b9e\u73b0\u7ec6\u8282\uff0c\u4ee5\u8bf7\u5047\u5ba1\u6279\u4e3a\u4f8b\u5b50\u770b\u770b\u5982\u4f55\u4f7f\u7528\u4ee3\u7801\u63cf\u8ff0\u4e00\u4e2a\u5de5\u4f5c\u6d41\u7684\u5904\u7406\u662f\u6613\u4e8e\u9605\u8bfb\u7684\u3002<br \/>\u65b9\u5f0f 1<br \/>class \u8bf7\u5047 {<br \/> public \u5f85\u53d1\u8d77(event, params){<br \/> if (event === \u53d1\u8d77){\u6dfb\u52a0\u5ef6\u65f6\u4efb\u52a1\u901a\u77e5\u8d85\u65f6,\u53d1\u51fa\u5ba1\u6279\u901a\u77e5;next(\u5f85\u5ba1\u6279)}<br \/> if (event === \u653e\u5f03){next(\u5173\u95ed)<br \/> }<br \/> public \u5f85\u5ba1\u6279(event, params){<br \/> if (event === \u540c\u610f){\u66f4\u65b0\u5e74\u5047\u4e1a\u52a1\u6570\u636e;next(\u901a\u8fc7)}<br \/> if (event === \u8d85\u65f6\u4e86){\u53d1\u9001\u8d85\u65f6\u901a\u77e5;next(\u8d85\u65f6)<br \/> }<br \/> public \u8d85\u65f6(event, params){<br \/> if (event === \u91cd\u65b0\u53d1\u8d77){\u4fee\u6539\u4e1a\u52a1\u6570\u636e;next(\u5f85\u5ba1\u6279)}<br \/> if (event === \u653e\u5f03){\u66f4\u65b0\u76f8\u5173\u6570\u636e;next(\u5173\u95ed)<br \/> }<br \/> public \u901a\u8fc7(event, params){<br \/> \/\/ \u7a7a\u5904\u7406\uff0c\u4ec5\u4f5c\u72b6\u6001\u8bb0\u5f55\uff0c\u4e0d\u4f1a\u518d\u54cd\u5e94\u5176\u5b83\u4e8b\u4ef6<br \/> }<br \/> public \u5173\u95ed(event, params){<br \/> \/\/ \u7a7a\u5904\u7406\uff0c\u4ec5\u4f5c\u72b6\u6001\u8bb0\u5f55\uff0c\u4e0d\u4f1a\u518d\u54cd\u5e94\u5176\u5b83\u4e8b\u4ef6<br \/> }<br \/>}<\/p>\n<p>\u65b9\u5f0f 2<br \/>class \u8bf7\u5047 {<br \/> public process(){<br \/> \u5f85\u53d1\u8d77: <br \/> event = this.event<br \/> if (event === \u53d1\u8d77) { \u66f4\u65b0\u4e1a\u52a1\u6570\u636e;goto \u5f85\u5ba1\u6279}<br \/> if (event === \u653e\u5f03) {goto \u5173\u95ed}<br \/> \u5f85\u5ba1\u6279: <br \/> event = this.event<br \/> if (event === \u540c\u610f) { \u66f4\u65b0\u4e1a\u52a1\u6570\u636e;goto \u901a\u8fc7}<br \/> if (event === \u8d85\u65f6\u4e86) {goto \u8d85\u65f6}<br \/> \u8d85\u65f6: <br \/> &#8230;<br \/> \u901a\u8fc7: <br \/> &#8230;<br \/> \u5173\u95ed:<br \/> &#8230;<br \/> }<br \/>}                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219419\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuanbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5de5\u4f5c\u6d41\u91cc\u9762\u914d\u7f6e\u4e00\u4e2a\u4e1a\u52a1\u7cfb\u7edf\u7684 url \u5c31\u884c\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219420\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tonnycao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u72b6\u6001\u673a\u6a21\u5f0f\u4e86\u89e3\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219421\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : passerbytiny <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u5df2\u7ecf\u60f3\u5230\u4e86\uff1a\u5206\u5e03\u5f0f\u4e8b\u4ef6\u3002\u53ea\u4e0d\u8fc7\u4e8b\u4ef6\u9a71\u52a8\u7684\u7f16\u7a0b\uff0c\u5f88\u96be\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219422\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rodrick <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6700\u8fd1\u6b63\u597d\u4e5f\u5728\u6574\u5de5\u4f5c\u6d41\u7684\u4e8b\uff0c\u8bf7\u95ee\u4f60\u4eec\u5de5\u4f5c\u6d41\u76f8\u5173\u7684\u6d41\u7a0b\u4e0e\u8868\u5355\u662f\u7528\u7684\u4ec0\u4e48\u6280\u672f\u6216\u8005\u5de5\u5177\u89e3\u51b3\u65b9\u6848                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219423\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : taowen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e1a\u52a1\u6570\u636e\u5c31\u4ee3\u8868\u4e86\u201c\u4e1a\u52a1\u6d41\u7a0b\u201d\u7684\u5f53\u524d\u72b6\u6001\u3002\u5f3a\u884c\u201c\u89e3\u8026\u201d\u53c8\u662f\u4f55\u5fc5\u5462\u3002\u4e0d\u5982\u628a\u4e1a\u52a1\u6570\u636e\u8fdb\u884c\u89c4\u8303\u5316\uff0c\u79f0\u4e3a single source of truth.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219424\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : leeg810312 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6d41\u7a0b\u7ba1\u7406\uff0c\u4e1a\u52a1\u6570\u636e\u5305\u542b\u6d41\u7a0b\u4fe1\u606f\u662f\u4e1a\u52a1\u9700\u8981\uff0c\u6ca1\u6709\u5fc5\u8981\u5265\u79bb\uff0c\u53ea\u8981\u5305\u542b\u6700\u5fc5\u8981\u7684\u6d41\u7a0b\u4fe1\u606f\u5373\u53ef\uff0c\u5982\u679c\u53ef\u4ee5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219425\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : FeifeiJin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u628a\u4e1a\u52a1\u6570\u636e\u548c\u5de5\u4f5c\u6d41\u6570\u636e\u62c6\u5206\u5f00\u3002<br \/>\u4e1a\u52a1\u6570\u636e\u8868\u4e0d\u53d8\u66f4\uff0c\u4e1a\u52a1\u6570\u636e\u8868\u91cc\u9700\u8981\u6709\u4e2a\u5168\u5c40\u552f\u4e00\u7684 schema_code<\/p>\n<p>\u628a\u6d41\u7a0b\u7684\u5de5\u4f5c\u72b6\u6001\u5b8c\u5168\u72ec\u7acb\u5728 workflow \u8868\u4e2d\u3002<br \/>id schema_code object_id<\/p>\n<p>\u7c7b\u4f3c\u8fd9\u6837\u7684\u7ed3\u6784\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4219426\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yao00jun <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6700\u8fd1\u63a5\u5230\u4e2a\u9700\u6c42\uff0c\u9700\u8981\u52a8\u6001\u5316\u914d\u7f6e activity \u5de5\u4f5c\u6d41 \u4efb\u52a1\u8282\u70b9\u4e2a\u6570\uff0c\u6bcf\u4e2a\u8282\u70b9\u7684\u5ba1\u6279\u4eba\u4e5f\u8981\u52a8\u6001\u5316\u914d\u7f6e\uff0c\u5728\u9014\u7684\u6d41\u7a0b\u4e5f\u8981\u652f\u6301\u52a8\u6001\u5316\u914d\u7f6e\u7684\u53d8\u66f4\u7ed3\u679c\uff0c\u4e0d\u6653\u5f97 activity \u652f\u6301\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5de5\u4f5c\u6d41 \u4e0e\u4e1a\u52a1\u6570\u636e\u6d41\u600e\u4e48\u89e3\u8026\uff1f \u8cc7&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/194652"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194652"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/194652\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194652"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}