新增服务网络建立流程图文档,优化边缘节点和代理服务的注册逻辑
This commit is contained in:
876
docs/服务网络建立流程图.excalidraw
Normal file
876
docs/服务网络建立流程图.excalidraw
Normal file
@@ -0,0 +1,876 @@
|
||||
{
|
||||
"type": "excalidraw",
|
||||
"version": 2,
|
||||
"source": "https://excalidraw.com",
|
||||
"elements": [
|
||||
{
|
||||
"id": "zsbeHr3kNPUaSvPMU-OMT",
|
||||
"type": "rectangle",
|
||||
"x": 583,
|
||||
"y": 200,
|
||||
"width": 116.99999999999997,
|
||||
"height": 400,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a0",
|
||||
"roundness": {
|
||||
"type": 3
|
||||
},
|
||||
"seed": 277020470,
|
||||
"version": 77,
|
||||
"versionNonce": 280720234,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "WZRxUygjSWpwJ9jCQGz64"
|
||||
}
|
||||
],
|
||||
"updated": 1747132847296,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"id": "WZRxUygjSWpwJ9jCQGz64",
|
||||
"type": "text",
|
||||
"x": 600.8700256347656,
|
||||
"y": 387.5,
|
||||
"width": 81.25994873046875,
|
||||
"height": 25,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a1",
|
||||
"roundness": null,
|
||||
"seed": 687766762,
|
||||
"version": 67,
|
||||
"versionNonce": 1888319018,
|
||||
"isDeleted": false,
|
||||
"boundElements": [],
|
||||
"updated": 1747132847296,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "platform",
|
||||
"fontSize": 20,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "zsbeHr3kNPUaSvPMU-OMT",
|
||||
"originalText": "platform",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "h_Vq2Fw7X05jQmOjpvwdp",
|
||||
"type": "rectangle",
|
||||
"x": 1200,
|
||||
"y": 200,
|
||||
"width": 200.00000000000003,
|
||||
"height": 100,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a2",
|
||||
"roundness": {
|
||||
"type": 3
|
||||
},
|
||||
"seed": 535145962,
|
||||
"version": 47,
|
||||
"versionNonce": 1571657718,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "PCRc2tKqmXazgf7vBXpBy"
|
||||
}
|
||||
],
|
||||
"updated": 1747132544466,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"id": "PCRc2tKqmXazgf7vBXpBy",
|
||||
"type": "text",
|
||||
"x": 1273.8300247192383,
|
||||
"y": 237.5,
|
||||
"width": 52.33995056152344,
|
||||
"height": 25,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a3",
|
||||
"roundness": null,
|
||||
"seed": 1744934570,
|
||||
"version": 32,
|
||||
"versionNonce": 1978592246,
|
||||
"isDeleted": false,
|
||||
"boundElements": [],
|
||||
"updated": 1747132358707,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "fwd...",
|
||||
"fontSize": 20,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "h_Vq2Fw7X05jQmOjpvwdp",
|
||||
"originalText": "fwd...",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "zNdFfRSAyIRsYWkHi09yH",
|
||||
"type": "rectangle",
|
||||
"x": 1201.152228201041,
|
||||
"y": 500,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a4",
|
||||
"roundness": {
|
||||
"type": 3
|
||||
},
|
||||
"seed": 1960286698,
|
||||
"version": 110,
|
||||
"versionNonce": 236636202,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "3DEBFPuFoQqTfJaMlPRtU"
|
||||
}
|
||||
],
|
||||
"updated": 1747132546398,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"id": "3DEBFPuFoQqTfJaMlPRtU",
|
||||
"type": "text",
|
||||
"x": 1270.5922535306308,
|
||||
"y": 537.5,
|
||||
"width": 61.11994934082031,
|
||||
"height": 25,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a5",
|
||||
"roundness": null,
|
||||
"seed": 1536135146,
|
||||
"version": 109,
|
||||
"versionNonce": 58765174,
|
||||
"isDeleted": false,
|
||||
"boundElements": [],
|
||||
"updated": 1747132520694,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "edge...",
|
||||
"fontSize": 20,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "zNdFfRSAyIRsYWkHi09yH",
|
||||
"originalText": "edge...",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "FaY6s3IeRlUKxMRwPzXX4",
|
||||
"type": "arrow",
|
||||
"x": 1161.5263313428777,
|
||||
"y": 201.7402520552557,
|
||||
"width": 420,
|
||||
"height": 0,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a6",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 1025214378,
|
||||
"version": 267,
|
||||
"versionNonce": 650402614,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "iCHZyeKUHerPacOJtYeYI"
|
||||
}
|
||||
],
|
||||
"updated": 1747132627325,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
-420,
|
||||
0
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": null,
|
||||
"endArrowhead": "arrow",
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "iCHZyeKUHerPacOJtYeYI",
|
||||
"type": "text",
|
||||
"x": 894.7183479444402,
|
||||
"y": 191.7402520552557,
|
||||
"width": 113.615966796875,
|
||||
"height": 20,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a6V",
|
||||
"roundness": null,
|
||||
"seed": 118902262,
|
||||
"version": 27,
|
||||
"versionNonce": 781320938,
|
||||
"isDeleted": false,
|
||||
"boundElements": null,
|
||||
"updated": 1747132957440,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "1. 注册转发服务",
|
||||
"fontSize": 16,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "FaY6s3IeRlUKxMRwPzXX4",
|
||||
"originalText": "1. 注册转发服务",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "po3Veg6YDVvp2KXkFaFuS",
|
||||
"type": "arrow",
|
||||
"x": 1161.152228201041,
|
||||
"y": 520.5986727826297,
|
||||
"width": 420,
|
||||
"height": 0,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a7",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 910967926,
|
||||
"version": 493,
|
||||
"versionNonce": 1269815542,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "6vSZb4yswl2PqEOZHsbfY"
|
||||
}
|
||||
],
|
||||
"updated": 1747132667478,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
-420,
|
||||
0
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": null,
|
||||
"endArrowhead": "arrow",
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "6vSZb4yswl2PqEOZHsbfY",
|
||||
"type": "text",
|
||||
"x": 892.896239126334,
|
||||
"y": 510.5986727826297,
|
||||
"width": 116.51197814941406,
|
||||
"height": 20,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a7V",
|
||||
"roundness": null,
|
||||
"seed": 781601642,
|
||||
"version": 36,
|
||||
"versionNonce": 1701769718,
|
||||
"isDeleted": false,
|
||||
"boundElements": null,
|
||||
"updated": 1747132957441,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "3. 注册边缘节点",
|
||||
"fontSize": 16,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "po3Veg6YDVvp2KXkFaFuS",
|
||||
"originalText": "3. 注册边缘节点",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "BNs2GbrhDdzbMBJzAWdwv",
|
||||
"type": "arrow",
|
||||
"x": 1300,
|
||||
"y": 460,
|
||||
"width": 0,
|
||||
"height": 120,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a8",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 799286378,
|
||||
"version": 309,
|
||||
"versionNonce": 925925802,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "Kx-Zgee6eTpVb7Mgq6W9S"
|
||||
}
|
||||
],
|
||||
"updated": 1747132974134,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
0,
|
||||
-120
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": null,
|
||||
"endArrowhead": "arrow",
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "Kx-Zgee6eTpVb7Mgq6W9S",
|
||||
"type": "text",
|
||||
"x": 1217.6640167236328,
|
||||
"y": 380,
|
||||
"width": 164.67196655273438,
|
||||
"height": 40,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a8V",
|
||||
"roundness": null,
|
||||
"seed": 1451839658,
|
||||
"version": 66,
|
||||
"versionNonce": 1319645994,
|
||||
"isDeleted": false,
|
||||
"boundElements": null,
|
||||
"updated": 1747132957442,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "5. 边缘节点连接到转发\n服务",
|
||||
"fontSize": 16,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "BNs2GbrhDdzbMBJzAWdwv",
|
||||
"originalText": "5. 边缘节点连接到转发服务",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "mFDQoiG3vbpyFwQBC7jyG",
|
||||
"type": "rectangle",
|
||||
"x": 198,
|
||||
"y": 351,
|
||||
"width": 200,
|
||||
"height": 100,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a9",
|
||||
"roundness": {
|
||||
"type": 3
|
||||
},
|
||||
"seed": 1351484214,
|
||||
"version": 37,
|
||||
"versionNonce": 1265028342,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "5y_lj25Q01lH09VvtpEee"
|
||||
}
|
||||
],
|
||||
"updated": 1747132838847,
|
||||
"link": null,
|
||||
"locked": false
|
||||
},
|
||||
{
|
||||
"id": "5y_lj25Q01lH09VvtpEee",
|
||||
"type": "text",
|
||||
"x": 277.6000213623047,
|
||||
"y": 388.5,
|
||||
"width": 40.799957275390625,
|
||||
"height": 25,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "a9V",
|
||||
"roundness": null,
|
||||
"seed": 1682566506,
|
||||
"version": 28,
|
||||
"versionNonce": 1110294070,
|
||||
"isDeleted": false,
|
||||
"boundElements": [],
|
||||
"updated": 1747132838847,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "user",
|
||||
"fontSize": 20,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "mFDQoiG3vbpyFwQBC7jyG",
|
||||
"originalText": "user",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "gcvXDtgBKjckbIcfsDhkr",
|
||||
"type": "arrow",
|
||||
"x": 423,
|
||||
"y": 399,
|
||||
"width": 129,
|
||||
"height": 0,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aA",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 1116663094,
|
||||
"version": 209,
|
||||
"versionNonce": 1517628458,
|
||||
"isDeleted": false,
|
||||
"boundElements": [],
|
||||
"updated": 1747132848563,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
129,
|
||||
0
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": null,
|
||||
"endArrowhead": "arrow",
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "i_8u5473xh1b8I_yoY07j",
|
||||
"type": "arrow",
|
||||
"x": 1160.743274975568,
|
||||
"y": 241.59697448672608,
|
||||
"width": 420,
|
||||
"height": 0,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aB",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 1331335734,
|
||||
"version": 72,
|
||||
"versionNonce": 624254710,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "hfpuERsbfPQwM7YecmMfg"
|
||||
}
|
||||
],
|
||||
"updated": 1747132629207,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
-420,
|
||||
0
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": "arrow",
|
||||
"endArrowhead": null,
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "hfpuERsbfPQwM7YecmMfg",
|
||||
"type": "text",
|
||||
"x": 888.3272974975407,
|
||||
"y": 231.59697448672608,
|
||||
"width": 124.83195495605469,
|
||||
"height": 20,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aBV",
|
||||
"roundness": null,
|
||||
"seed": 127815402,
|
||||
"version": 26,
|
||||
"versionNonce": 772697526,
|
||||
"isDeleted": false,
|
||||
"boundElements": null,
|
||||
"updated": 1747132957442,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "2. 平台返回 200",
|
||||
"fontSize": 16,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "i_8u5473xh1b8I_yoY07j",
|
||||
"originalText": "2. 平台返回 200",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "PjDN6opphck2HkSYTe1Ln",
|
||||
"type": "arrow",
|
||||
"x": 1159.5713063315768,
|
||||
"y": 581.2037355477607,
|
||||
"width": 420,
|
||||
"height": 0,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aE",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 1407186474,
|
||||
"version": 38,
|
||||
"versionNonce": 580002102,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "2qs1YbvHnFM3og-O2ZoRa"
|
||||
}
|
||||
],
|
||||
"updated": 1747132598748,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
-420,
|
||||
0
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": "arrow",
|
||||
"endArrowhead": null,
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "2qs1YbvHnFM3og-O2ZoRa",
|
||||
"type": "text",
|
||||
"x": 875.4993229941745,
|
||||
"y": 571.2037355477607,
|
||||
"width": 148.1439666748047,
|
||||
"height": 20,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aF",
|
||||
"roundness": null,
|
||||
"seed": 983535734,
|
||||
"version": 71,
|
||||
"versionNonce": 1835696502,
|
||||
"isDeleted": false,
|
||||
"boundElements": null,
|
||||
"updated": 1747132957442,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "4. 平台分配转发服务",
|
||||
"fontSize": 16,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "PjDN6opphck2HkSYTe1Ln",
|
||||
"originalText": "4. 平台分配转发服务",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
},
|
||||
{
|
||||
"id": "8AtKcV9AvqUvk2Mr9flrI",
|
||||
"type": "arrow",
|
||||
"x": 740,
|
||||
"y": 280,
|
||||
"width": 420,
|
||||
"height": 0,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aH",
|
||||
"roundness": {
|
||||
"type": 2
|
||||
},
|
||||
"seed": 1080875126,
|
||||
"version": 25,
|
||||
"versionNonce": 1872649834,
|
||||
"isDeleted": false,
|
||||
"boundElements": [
|
||||
{
|
||||
"type": "text",
|
||||
"id": "sZja5umzjfTmtuZDk_hsS"
|
||||
}
|
||||
],
|
||||
"updated": 1747132657373,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"points": [
|
||||
[
|
||||
0,
|
||||
0
|
||||
],
|
||||
[
|
||||
420,
|
||||
0
|
||||
]
|
||||
],
|
||||
"lastCommittedPoint": null,
|
||||
"startBinding": null,
|
||||
"endBinding": null,
|
||||
"startArrowhead": "arrow",
|
||||
"endArrowhead": null,
|
||||
"elbowed": false
|
||||
},
|
||||
{
|
||||
"id": "sZja5umzjfTmtuZDk_hsS",
|
||||
"type": "text",
|
||||
"x": 859.4880142211914,
|
||||
"y": 270,
|
||||
"width": 181.0239715576172,
|
||||
"height": 20,
|
||||
"angle": 0,
|
||||
"strokeColor": "#1e1e1e",
|
||||
"backgroundColor": "transparent",
|
||||
"fillStyle": "solid",
|
||||
"strokeWidth": 2,
|
||||
"strokeStyle": "solid",
|
||||
"roughness": 1,
|
||||
"opacity": 100,
|
||||
"groupIds": [],
|
||||
"frameId": null,
|
||||
"index": "aI",
|
||||
"roundness": null,
|
||||
"seed": 705278454,
|
||||
"version": 41,
|
||||
"versionNonce": 1536576426,
|
||||
"isDeleted": false,
|
||||
"boundElements": null,
|
||||
"updated": 1747132957443,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
"text": "6. 转发服务更新端口信息",
|
||||
"fontSize": 16,
|
||||
"fontFamily": 5,
|
||||
"textAlign": "center",
|
||||
"verticalAlign": "middle",
|
||||
"containerId": "8AtKcV9AvqUvk2Mr9flrI",
|
||||
"originalText": "6. 转发服务更新端口信息",
|
||||
"autoResize": true,
|
||||
"lineHeight": 1.25
|
||||
}
|
||||
],
|
||||
"appState": {
|
||||
"gridSize": 20,
|
||||
"gridStep": 5,
|
||||
"gridModeEnabled": false,
|
||||
"viewBackgroundColor": "#ffffff"
|
||||
},
|
||||
"files": {}
|
||||
}
|
||||
@@ -1,20 +1,23 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"gorm.io/gen/field"
|
||||
edge2 "platform/web/domains/edge"
|
||||
proxy2 "platform/web/domains/proxy"
|
||||
g "platform/web/globals"
|
||||
m "platform/web/models"
|
||||
q "platform/web/queries"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"gorm.io/gen/field"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
type RegisterEdgeReq struct {
|
||||
Name int `json:"name" validate:"required"`
|
||||
Version int `json:"version" validate:"required"`
|
||||
ISP int `json:"isp" validate:"required"`
|
||||
Prov string `json:"prov" validate:"required"`
|
||||
City string `json:"city" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
Version int `json:"version" validate:"required"`
|
||||
ISP edge2.ISP `json:"isp"`
|
||||
Prov string `json:"prov"`
|
||||
City string `json:"city"`
|
||||
}
|
||||
|
||||
type RegisterEdgeResp struct {
|
||||
@@ -44,13 +47,19 @@ func OnlineEdge(c *fiber.Ctx) (err error) {
|
||||
}
|
||||
|
||||
// 保存节点信息
|
||||
err = q.Edge.Save(&m.Edge{
|
||||
err = q.Edge.Clauses(clause.OnConflict{
|
||||
UpdateAll: true,
|
||||
Columns: []clause.Column{{Name: "name"}},
|
||||
}).Create(&m.Edge{
|
||||
Name: req.Name,
|
||||
Version: int32(req.Version),
|
||||
Host: c.IP(),
|
||||
Host: c.Context().RemoteIP().String(),
|
||||
Isp: int32(req.ISP),
|
||||
Prov: req.Prov,
|
||||
City: req.City,
|
||||
ProxyID: fwd.ID,
|
||||
Type: int32(edge2.TypeSelfHosted),
|
||||
Status: 1,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"gorm.io/gorm/clause"
|
||||
"log/slog"
|
||||
auth2 "platform/web/auth"
|
||||
proxy2 "platform/web/domains/proxy"
|
||||
g "platform/web/globals"
|
||||
m "platform/web/models"
|
||||
q "platform/web/queries"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
// region OnlineProxy
|
||||
@@ -36,7 +37,8 @@ func OnlineProxy(c *fiber.Ctx) (err error) {
|
||||
}
|
||||
|
||||
// 创建代理
|
||||
slog.Debug("注册转发服务", "ip", c.IP())
|
||||
ip := c.Context().RemoteIP()
|
||||
slog.Debug("注册转发服务", "ip", ip)
|
||||
err = q.Proxy.
|
||||
Clauses(clause.OnConflict{
|
||||
UpdateAll: true,
|
||||
@@ -47,7 +49,7 @@ func OnlineProxy(c *fiber.Ctx) (err error) {
|
||||
Create(&m.Proxy{
|
||||
Name: req.Name,
|
||||
Version: int32(req.Version),
|
||||
Host: c.IP(),
|
||||
Host: ip.String(),
|
||||
Type: int32(proxy2.TypeSelfHosted),
|
||||
Status: 1,
|
||||
})
|
||||
|
||||
@@ -71,4 +71,9 @@ func ApplyRouters(app *fiber.App) {
|
||||
// 节点
|
||||
edge := api.Group("/edge")
|
||||
edge.Post("/online", handlers.OnlineEdge)
|
||||
|
||||
// 临时
|
||||
app.Get("/test", func(c *fiber.Ctx) error {
|
||||
return c.JSON(c.GetReqHeaders())
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user