{
    "componentChunkName": "component---src-templates-issues-tsx",
    "path": "/issues/410",
    "result": {"data":{"issuesJson":{"id":"175d4983-cbfa-5d43-aff3-00fdb38ad14a","title":"barats/ohUrlShortener: 企业级短链接服务系统，支持短链接生产、查询及302转向，并自带点击量统计、独立 IP 数统计、访问日志","number":410,"bodyHTML":"<div align=\"center\" dir=\"auto\">\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a><br><br></p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th align=\"right\">Repos</th>\n<th align=\"left\"><a href=\"https://github.com/barats/ohUrlShortener\">barats/ohUrlShortener</a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\"><strong>Views</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/a73da5bb2cc72fa3cfc91dcabf8097f4ab8da898815a8fc1628bd5e3274e5e95/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6261726174732f6f6855726c53686f7274656e65722e737667\" alt=\"views\" data-canonical-src=\"https://views.whatilearened.today/views/github/barats/ohUrlShortener.svg\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Stars</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/e4afe15bb8094a71dc971cbc9d079ae0b1e89d18d1d4e61d9b9b8f32223b9fd3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6261726174732f6f6855726c53686f7274656e65723f636f6c6f723d663266303864266c6f676f3d556e64657274616c65266c6f676f436f6c6f723d656234363330\" alt=\"stars\" data-canonical-src=\"https://img.shields.io/github/stars/barats/ohUrlShortener?color=f2f08d&amp;logo=Undertale&amp;logoColor=eb4630\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Forks</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/699f8e78f32d60cf9e859727f17064fef2e58c422d6bd2cd5e1d965ae7831827/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6261726174732f6f6855726c53686f7274656e65723f636f6c6f723d626138366562266c6f676f3d48616e647368616b65266c6f676f436f6c6f723d656136616136\" alt=\"forks\" data-canonical-src=\"https://img.shields.io/github/forks/barats/ohUrlShortener?color=ba86eb&amp;logo=Handshake&amp;logoColor=ea6aa6\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>License</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/0c93ca71e73bb599dbfbd81eb5bbb82f63a427dc55ced5d8a7de2d4025f1f1c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c2d4e4f4e452d626c75653f6c6f676f3d756e6c6963656e7365\" alt=\"license\" data-canonical-src=\"https://img.shields.io/badge/L-NONE-blue?logo=unlicense\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>UpdatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/5658aac04eed6f77371f575b2ab08f46a723ea5a592a4b358e271de8ad1fe35f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6261726174732f6f6855726c53686f7274656e65723f646973706c61795f74696d657374616d703d636f6d6d6974746572266c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d557064617465644174\" alt=\"last-commit\" data-canonical-src=\"https://img.shields.io/github/last-commit/barats/ohUrlShortener?display_timestamp=committer&amp;logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=UpdatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>CreatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/a7990a2bca2149fdaad411703f16ba7f2e21956579c5d0529dc728419742f49f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f637265617465642d61742f6261726174732f6f6855726c53686f7274656e65723f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d437265617465644174\" alt=\"create-at\" data-canonical-src=\"https://img.shields.io/github/created-at/barats/ohUrlShortener?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=CreatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<a href=\"https://github.com/opsre/awesome-ops\">\n</a><p dir=\"auto\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b964a36ea4078c39f603d46a29436371c7541a2f26e0228d7b21b9d9805b43d3/68747470733a2f2f736f6369616c6966792e6769742e63692f6f707372652f617765736f6d652d6f70732f696d6167653f6465736372697074696f6e3d3126666f6e743d42697474657226666f726b733d31266973737565733d31266c616e67756167653d31266c6f676f3d6874747073253341253246253246617661746172732e67697468756275736572636f6e74656e742e636f6d25324675253246313838353638303230266e616d653d31266f776e65723d31267061747465726e3d436972637569742b426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874\" alt=\"\" data-canonical-src=\"https://socialify.git.ci/opsre/awesome-ops/image?description=1&amp;font=Bitter&amp;forks=1&amp;issues=1&amp;language=1&amp;logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F188568020&amp;name=1&amp;owner=1&amp;pattern=Circuit+Board&amp;pulls=1&amp;stargazers=1&amp;theme=Light\" style=\"max-width: 100%;\"></a></p>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a>\n</div>\n<h1 dir=\"auto\">ohUrlShortener</h1>\n<p dir=\"auto\">适合中小型社区网站使用的企业级短链接服务系统，支持短链接生产、查询及302转向，并自带点击量统计、独立IP数统计、访问日志查询：</p>\n<ol dir=\"auto\">\n<li>支持 Docker One Step Start 部署启动</li>\n<li>支持短链接生产、查询、存储、302转向</li>\n<li>支持访问日志查询、访问量统计、独立IP数统计</li>\n<li>支持 HTTP API 方式新建短链接、禁用/启用短链接、查看短链接统计信息、管理员设置</li>\n<li>支持访问日志导出，方便线下分析</li>\n</ol>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"screenshot.jpg\"><img src=\"screenshot.jpg\" alt=\"Screenshot\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">\n<a href=\"https://www.ohurls.cn\" rel=\"nofollow\">https://www.ohurls.cn</a><br><br>\n<a href=\"https://github.com/barats/ohUrlShortener/stargazers\"><img src=\"https://camo.githubusercontent.com/4649ee21349230a519b5c1d8d70895713922099fc9aaca833ddae87f4e91a438/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6261726174732f6f6855726c53686f7274656e6572\" data-canonical-src=\"https://img.shields.io/github/stars/barats/ohUrlShortener\" style=\"max-width: 100%;\"></a>\n<a href=\"https://github.com/barats/ohUrlShortener/network/members\"><img src=\"https://camo.githubusercontent.com/addb7931b4c559ec3b2214a32e64c1c5a6ea09e0d0151029108adc414e5c4004/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6261726174732f6f6855726c53686f7274656e6572\" data-canonical-src=\"https://img.shields.io/github/forks/barats/ohUrlShortener\" style=\"max-width: 100%;\"></a>\n<a href=\"https://github.com/barats/ohUrlShortener/issues\"><img src=\"https://camo.githubusercontent.com/b621e871755583a5344e34b097b87d802a376eee3b54e8c195eebbb8e90fbe52/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6261726174732f6f6855726c53686f7274656e6572\" data-canonical-src=\"https://img.shields.io/github/issues/barats/ohUrlShortener\" style=\"max-width: 100%;\"></a>  \n<a href=\"https://gitee.com/barat/ohurlshortener/stargazers\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/654267687093909a636c4ed8f90cd6d00e64f828b7a42a0b6d348e8540502959/68747470733a2f2f67697465652e636f6d2f62617261742f6f6875726c73686f7274656e65722f62616467652f737461722e7376673f7468656d653d6461726b\" data-canonical-src=\"https://gitee.com/barat/ohurlshortener/badge/star.svg?theme=dark\" style=\"max-width: 100%;\"></a>\n<a href=\"https://gitee.com/barat/ohurlshortener/members\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/ea7b0d3c5027d1c28f8db7e03694a126be7b26fb9c1c281f3a5e206439e3a957/68747470733a2f2f67697465652e636f6d2f62617261742f6f6875726c73686f7274656e65722f62616467652f666f726b2e7376673f7468656d653d6461726b\" data-canonical-src=\"https://gitee.com/barat/ohurlshortener/badge/fork.svg?theme=dark\" style=\"max-width: 100%;\"></a>\n<a href=\"https://www.oschina.net/comment/project/64133\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/1c42cf1997fb03bf2526d3ec99c0367efb1df684632ea90da00d4cac85bcd70a/68747470733a2f2f7777772e6f736368696e612e6e65742f636f6d6d656e742f62616467652f70726f6a6563742f3634313333\" data-canonical-src=\"https://www.oschina.net/comment/badge/project/64133\" style=\"max-width: 100%;\"></a> \n<a href=\"https://hub.docker.com/r/baratsemet/ohurlshortener-portal\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/fca33aae073c3108a4ef5c69818c9a205e8ce7c156004dfa6842b59812ae0cce/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f626172617473656d65742f6f6875726c73686f7274656e65722d706f7274616c\" alt=\"Portal Docker Pulls\" data-canonical-src=\"https://img.shields.io/docker/pulls/baratsemet/ohurlshortener-portal\" style=\"max-width: 100%;\"></a>\n<a href=\"https://hub.docker.com/r/baratsemet/ohurlshortener-admin\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/a389dda9cfd7a20e6b8f8faeb6c05b13d3d4eae35ca38152dcae9ea08f248ad3/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f626172617473656d65742f6f6875726c73686f7274656e65722d61646d696e\" alt=\"Admin Docker Pulls\" data-canonical-src=\"https://img.shields.io/docker/pulls/baratsemet/ohurlshortener-admin\" style=\"max-width: 100%;\"></a>\n</p>\n<h2 dir=\"auto\">快速使用</h2>\n<p dir=\"auto\">Docker 一步启动所有服务，运行 <code class=\"notranslate\">docker/one_step_start.sh</code> ，该命令将会：</p>\n<ol dir=\"auto\">\n<li>拉取 <a href=\"https://hub.docker.com/r/baratsemet/ohurlshortener-admin\" rel=\"nofollow\">baratsemet/ohurlshortener-admin</a> 镜像（本地构建可查看 <code class=\"notranslate\">docker/admin.Dockerfile</code>）</li>\n<li>拉取 <a href=\"https://hub.docker.com/r/baratsemet/ohurlshortener-portal\" rel=\"nofollow\">baratsemet/ohurlshortener-portal</a> 镜像（本地构建镜像可查看<code class=\"notranslate\">docker/portal.Dockerfile</code>）</li>\n<li>通过 <code class=\"notranslate\">docker/pull_build.yml</code> 其他描述内容构建 <code class=\"notranslate\">redis</code> 和 <code class=\"notranslate\">postgresql</code> 镜像及服务，并对其运行状态做判断，等待缓存和数据库服务正常之后，再启动其他必要服务 (本地构建镜像请查阅 <code class=\"notranslate\">local_build.yml</code>)</li>\n<li>构建名为 <code class=\"notranslate\">network_ohurlshortener</code> 的虚拟网络供上述服务使用</li>\n<li>开启本机 <code class=\"notranslate\">9091</code>、<code class=\"notranslate\">9092</code> 端口分别应对 <code class=\"notranslate\">ohUrlShortener-Portal</code> 及 <code class=\"notranslate\">ohUrlShortener-Admin</code> 应用</li>\n</ol>\n<h2 dir=\"auto\">参数说明</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"ohurlshortener [-c config_file] [-s admin|portal|&lt;omit to start both&gt;]  \"><pre class=\"notranslate\">ohurlshortener [-c config_file] [-s admin<span class=\"pl-k\">|</span>portal<span class=\"pl-k\">|</span><span class=\"pl-k\">&lt;</span>omit to start both<span class=\"pl-k\">&gt;</span>]  </pre></div>\n<h2 dir=\"auto\">配置文件</h2>\n<p dir=\"auto\">根目录下 <code class=\"notranslate\">config.ini</code> 中存放着关于 ohUrlShortener 短链接系统的一些必要配置，请在启动应用之前确保这些配置的正确性</p>\n<div class=\"highlight highlight-source-ini notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[app]\n\n# 短链接系统本地启动端口\nport = 9091\n\n# 短链接系统管理后台本地启动端口\nadmin_port = 9092\n\n# 例如：https://t.cn/ 是前缀(不要忘记最后一个/符号)\nurl_prefix = http://localhost:9091/\n\n# captcha 验证码默认会写入内存，也可以指定存储到 redis\n[captcha]\nstore = memory\n# store = redis\n\n# Redis 配置信息 \n[redis]\nhost = redis:6379\ndatabase = 0\nusername =\npassword =\npool_size = 50\n\n# Redis 集群配置\n[redis-cluster]\nhosts = localhost:6371,localhost:6372,localhost:6373,localhost:6374,localhost:6375,localhost:6376\nusername = \npassword = \npool_size = 50\n\n# Postgresql 数据库配置信息\n[postgres]\nhost = localhost\nport = 5432\nuser = postgres\npassword = xxx\ndatabase = oh_url_shortener\nmax_open_conn = 20\nmax_idle_conn = 5\"><pre class=\"notranslate\"><span class=\"pl-en\">[app]</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> 短链接系统本地启动端口</span>\n<span class=\"pl-k\">port</span> = 9091\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> 短链接系统管理后台本地启动端口</span>\n<span class=\"pl-k\">admin_port</span> = 9092\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> 例如：https://t.cn/ 是前缀(不要忘记最后一个/符号)</span>\n<span class=\"pl-k\">url_prefix</span> = http://localhost:9091/\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> captcha 验证码默认会写入内存，也可以指定存储到 redis</span>\n<span class=\"pl-en\">[captcha]</span>\n<span class=\"pl-k\">store</span> = memory\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> store = redis</span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Redis 配置信息 </span>\n<span class=\"pl-en\">[redis]</span>\n<span class=\"pl-k\">host</span> = redis:6379\n<span class=\"pl-k\">database</span> = 0\n<span class=\"pl-k\">username</span> =\n<span class=\"pl-k\">password</span> =\n<span class=\"pl-k\">pool_size</span> = 50\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Redis 集群配置</span>\n<span class=\"pl-en\">[redis-cluster]</span>\n<span class=\"pl-k\">hosts</span> = localhost:6371,localhost:6372,localhost:6373,localhost:6374,localhost:6375,localhost:6376\n<span class=\"pl-k\">username</span> = \n<span class=\"pl-k\">password</span> = \n<span class=\"pl-k\">pool_size</span> = 50\n\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> Postgresql 数据库配置信息</span>\n<span class=\"pl-en\">[postgres]</span>\n<span class=\"pl-k\">host</span> = localhost\n<span class=\"pl-k\">port</span> = 5432\n<span class=\"pl-k\">user</span> = postgres\n<span class=\"pl-k\">password</span> = xxx\n<span class=\"pl-k\">database</span> = oh_url_shortener\n<span class=\"pl-k\">max_open_conn</span> = 20\n<span class=\"pl-k\">max_idle_conn</span> = 5</pre></div>\n<h2 dir=\"auto\">Admin 后台默认帐号</h2>\n<p dir=\"auto\">默认帐号: <code class=\"notranslate\">ohUrlShortener</code><br>\n默认密码: <code class=\"notranslate\">-2aDzm=0(ln_9^1</code></p>\n<p dir=\"auto\">数据库中存储的是加密后的密码，在 <a href=\"structure.sql\"><code class=\"notranslate\">structure.sql</code></a> 中标有注释，如果需要自定义其他密码，可以修改这里</p>\n<p dir=\"auto\">加密规则 <code class=\"notranslate\">storage/users_storage.go</code> 中</p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"func PasswordBase58Hash(password string) (string, error) {\n\tdata, err := utils.Sha256Of(password)\n\tif err != nil {\n\t\treturn &quot;&quot;, err\n\t}\n\treturn base58.Encode(data), nil\n}\"><pre class=\"notranslate\"><span class=\"pl-k\">func</span> <span class=\"pl-s1\">PasswordBase58Hash</span>(<span class=\"pl-s1\">password</span> <span class=\"pl-smi\">string</span>) (<span class=\"pl-smi\">string</span>, <span class=\"pl-smi\">error</span>) {\n\t<span class=\"pl-s1\">data</span>, <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">utils</span>.<span class=\"pl-c1\">Sha256Of</span>(<span class=\"pl-s1\">password</span>)\n\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">!=</span> <span class=\"pl-c1\">nil</span> {\n\t\t<span class=\"pl-k\">return</span> <span class=\"pl-s\">\"\"</span>, <span class=\"pl-s1\">err</span>\n\t}\n\t<span class=\"pl-k\">return</span> <span class=\"pl-s1\">base58</span>.<span class=\"pl-c1\">Encode</span>(<span class=\"pl-s1\">data</span>), <span class=\"pl-c1\">nil</span>\n}</pre></div>\n<p dir=\"auto\">亦可参照 <code class=\"notranslate\">storage/users_storage_test.go</code> 中的 <code class=\"notranslate\">TestNewUser()</code> 方法</p>\n<h2 dir=\"auto\">HTTP API 支持</h2>\n<p dir=\"auto\">管理端 HTTP API 支持请参阅 <a href=\"API.md\">ohUrlShortener HTTP API</a></p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"api := router.Group(&quot;/api&quot;, controller.APIAuthHandler())\napi.POST(&quot;/account&quot;, controller.APINewAdmin)\napi.PUT(&quot;/account/:account/update&quot;, controller.APIAdminUpdate)\napi.POST(&quot;/url&quot;, controller.APIGenShortUrl)\napi.GET(&quot;/url/:url&quot;, controller.APIUrlInfo)\napi.DELETE(&quot;/url/:url&quot;, controller.APIDeleteUrl)\napi.PUT(&quot;/url/:url/change_state&quot;, controller.APIUpdateUrl)\"><pre class=\"notranslate\"><span class=\"pl-s1\">api</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">router</span>.<span class=\"pl-c1\">Group</span>(<span class=\"pl-s\">\"/api\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APIAuthHandler</span>())\n<span class=\"pl-s1\">api</span>.<span class=\"pl-c1\">POST</span>(<span class=\"pl-s\">\"/account\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APINewAdmin</span>)\n<span class=\"pl-s1\">api</span>.<span class=\"pl-c1\">PUT</span>(<span class=\"pl-s\">\"/account/:account/update\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APIAdminUpdate</span>)\n<span class=\"pl-s1\">api</span>.<span class=\"pl-c1\">POST</span>(<span class=\"pl-s\">\"/url\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APIGenShortUrl</span>)\n<span class=\"pl-s1\">api</span>.<span class=\"pl-c1\">GET</span>(<span class=\"pl-s\">\"/url/:url\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APIUrlInfo</span>)\n<span class=\"pl-s1\">api</span>.<span class=\"pl-c1\">DELETE</span>(<span class=\"pl-s\">\"/url/:url\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APIDeleteUrl</span>)\n<span class=\"pl-s1\">api</span>.<span class=\"pl-c1\">PUT</span>(<span class=\"pl-s\">\"/url/:url/change_state\"</span>, <span class=\"pl-s1\">controller</span>.<span class=\"pl-c1\">APIUpdateUrl</span>)</pre></div>\n<h2 dir=\"auto\">短链接在应用启动时会存入 Redis 中</h2>\n<p dir=\"auto\">所有短链接再系统启动时会以 <code class=\"notranslate\">Key(short_url) -&gt; Value(JSON{original_url,open_type})</code> 的形式存储在 Redis 中。</p>\n<h3 dir=\"auto\">1. 为什么要这么做？</h3>\n<p dir=\"auto\">当短链接的查询请求进入应用时，为了能够更快、更准确的将用户请求转向到目标链接，与传统的方式从数据库中查询相比，直接从 Redis 中获取目标链接就会显得更有价值。</p>\n<h3 dir=\"auto\">2. 这种处理方式有什么缺点？</h3>\n<p dir=\"auto\">理论上来说，如果 Redis 所在的服务器的内存较大的话，存储10w个Key也是可以的。但是，硬件条件不允许的情况下，就需要控制 Redis 中的 Key 数量（主要是怕机器扛不住，Redis 本身的性能不会有问题）。这部分的功能扩展，考虑在将来的某个版本中实现并允许配置管理。</p>\n<h3 dir=\"auto\">3. 万一</h3>\n<p dir=\"auto\">考虑到可扩展性，多封装了一层 <code class=\"notranslate\">service</code>，以便需要的时候在业务逻辑层进行自定义扩展，eg：将 key 查询改成数据库查询等。</p>\n<h2 dir=\"auto\">短链接生产过程相关代码</h2>\n<p dir=\"auto\">所在文件 <code class=\"notranslate\">core/short_url.go</code></p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"func GenerateShortLink(initialLink string) (string, error) {\n\tif utils.EmptyString(initialLink) {\n\t\treturn &quot;&quot;, fmt.Errorf(&quot;empty string&quot;)\n\t}\n\turlHash, err := utils.Sha256Of(initialLink)\n\tif err != nil {\n\t\treturn &quot;&quot;, err\n\t}\n\tstr := utils.Base58Encode(urlHash)\n\treturn str[:8], nil\n}\"><pre class=\"notranslate\"><span class=\"pl-k\">func</span> <span class=\"pl-s1\">GenerateShortLink</span>(<span class=\"pl-s1\">initialLink</span> <span class=\"pl-smi\">string</span>) (<span class=\"pl-smi\">string</span>, <span class=\"pl-smi\">error</span>) {\n\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">utils</span>.<span class=\"pl-c1\">EmptyString</span>(<span class=\"pl-s1\">initialLink</span>) {\n\t\t<span class=\"pl-k\">return</span> <span class=\"pl-s\">\"\"</span>, <span class=\"pl-s1\">fmt</span>.<span class=\"pl-c1\">Errorf</span>(<span class=\"pl-s\">\"empty string\"</span>)\n\t}\n\t<span class=\"pl-s1\">urlHash</span>, <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">utils</span>.<span class=\"pl-c1\">Sha256Of</span>(<span class=\"pl-s1\">initialLink</span>)\n\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">!=</span> <span class=\"pl-c1\">nil</span> {\n\t\t<span class=\"pl-k\">return</span> <span class=\"pl-s\">\"\"</span>, <span class=\"pl-s1\">err</span>\n\t}\n\t<span class=\"pl-s1\">str</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">utils</span>.<span class=\"pl-c1\">Base58Encode</span>(<span class=\"pl-s1\">urlHash</span>)\n\t<span class=\"pl-k\">return</span> <span class=\"pl-s1\">str</span>[:<span class=\"pl-c1\">8</span>], <span class=\"pl-c1\">nil</span>\n}</pre></div>\n<h2 dir=\"auto\">访问日志处理间隔：1分钟</h2>\n<p dir=\"auto\">所在文件 <code class=\"notranslate\">main.go</code></p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"//清理 Redis 中的访问日志的时间间隔\nconst AccessLogCleanInterval = 1 * time.Minute\n\nfunc startTicker() error {\n\tticker := time.NewTicker(AccessLogCleanInterval)\n\tfor range ticker.C {\n\t\tlog.Println(&quot;[StoreAccessLog] Start.&quot;)\n\t\tif err := service.StoreAccessLogs(); err != nil {\n\t\t\tlog.Printf(&quot;Error while trying to store access_log %s&quot;, err)\n\t\t}\n\t\tlog.Println(&quot;[StoreAccessLog] Finish.&quot;)\n\t}\n\treturn nil\n}\"><pre class=\"notranslate\"><span class=\"pl-c\">//清理 Redis 中的访问日志的时间间隔</span>\n<span class=\"pl-k\">const</span> <span class=\"pl-s1\">AccessLogCleanInterval</span> <span class=\"pl-c1\">=</span> <span class=\"pl-c1\">1</span> <span class=\"pl-c1\">*</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">Minute</span>\n\n<span class=\"pl-k\">func</span> <span class=\"pl-s1\">startTicker</span>() <span class=\"pl-smi\">error</span> {\n\t<span class=\"pl-s1\">ticker</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">NewTicker</span>(<span class=\"pl-s1\">AccessLogCleanInterval</span>)\n\t<span class=\"pl-k\">for</span> <span class=\"pl-k\">range</span> <span class=\"pl-s1\">ticker</span>.<span class=\"pl-c1\">C</span> {\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[StoreAccessLog] Start.\"</span>)\n\t\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">service</span>.<span class=\"pl-c1\">StoreAccessLogs</span>(); <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">!=</span> <span class=\"pl-c1\">nil</span> {\n\t\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Printf</span>(<span class=\"pl-s\">\"Error while trying to store access_log %s\"</span>, <span class=\"pl-s1\">err</span>)\n\t\t}\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[StoreAccessLog] Finish.\"</span>)\n\t}\n\t<span class=\"pl-k\">return</span> <span class=\"pl-c1\">nil</span>\n}</pre></div>\n<h2 dir=\"auto\">当日 Top25 访问 URL 榜单处理间隔：5分钟</h2>\n<p dir=\"auto\">所在文件 <code class=\"notranslate\">main.go</code></p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Top25 榜单计算间隔\nTop25CalcInterval = 5 * time.Minute\n\nfunc startTicker2() error {\n\ttop25Ticker := time.NewTicker(Top25CalcInterval)\n\tfor range top25Ticker.C {\n\t\tlog.Println(&quot;[Top25Urls Ticker] Start.&quot;)\n\t\tif err := storage.CallProcedureStatsTop25(); err != nil {\n\t\t\tlog.Printf(&quot;Error while trying to calculate Top25Urls %s&quot;, err)\n\t\t}\n\t\tlog.Println(&quot;[Top25Urls Ticker] Finish.&quot;)\n\t}\n\treturn nil\n}\"><pre class=\"notranslate\"><span class=\"pl-c\">// Top25 榜单计算间隔</span>\n<span class=\"pl-s1\">Top25CalcInterval</span> <span class=\"pl-c1\">=</span> <span class=\"pl-c1\">5</span> <span class=\"pl-c1\">*</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">Minute</span>\n\n<span class=\"pl-k\">func</span> <span class=\"pl-s1\">startTicker2</span>() <span class=\"pl-smi\">error</span> {\n\t<span class=\"pl-s1\">top25Ticker</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">NewTicker</span>(<span class=\"pl-s1\">Top25CalcInterval</span>)\n\t<span class=\"pl-k\">for</span> <span class=\"pl-k\">range</span> <span class=\"pl-s1\">top25Ticker</span>.<span class=\"pl-c1\">C</span> {\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[Top25Urls Ticker] Start.\"</span>)\n\t\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">storage</span>.<span class=\"pl-c1\">CallProcedureStatsTop25</span>(); <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">!=</span> <span class=\"pl-c1\">nil</span> {\n\t\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Printf</span>(<span class=\"pl-s\">\"Error while trying to calculate Top25Urls %s\"</span>, <span class=\"pl-s1\">err</span>)\n\t\t}\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[Top25Urls Ticker] Finish.\"</span>)\n\t}\n\t<span class=\"pl-k\">return</span> <span class=\"pl-c1\">nil</span>\n}</pre></div>\n<h2 dir=\"auto\">仪表盘中几个相关统计处理间隔：5分钟</h2>\n<p dir=\"auto\">所在文件 <code class=\"notranslate\">main.go</code></p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// 仪表盘页面中其他几个统计数据计算间隔\nStatsSumCalcInterval = 5 * time.Minute\n\nfunc startTicker4() error {\n\tstatsSumTicker := time.NewTicker(StatsSumCalcInterval)\n\tfor range statsSumTicker.C {\n\t\tlog.Println(&quot;[StatsSum Ticker] Start.&quot;)\n\t\tif err := storage.CallProcedureStatsSum(); err != nil {\n\t\t\tlog.Printf(&quot;Error while trying to calculate StatsSum %s&quot;, err)\n\t\t}\n\t\tlog.Println(&quot;[StatsSum Ticker] Finish.&quot;)\n\t}\n\treturn nil\n}\"><pre class=\"notranslate\"><span class=\"pl-c\">// 仪表盘页面中其他几个统计数据计算间隔</span>\n<span class=\"pl-s1\">StatsSumCalcInterval</span> <span class=\"pl-c1\">=</span> <span class=\"pl-c1\">5</span> <span class=\"pl-c1\">*</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">Minute</span>\n\n<span class=\"pl-k\">func</span> <span class=\"pl-s1\">startTicker4</span>() <span class=\"pl-smi\">error</span> {\n\t<span class=\"pl-s1\">statsSumTicker</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">NewTicker</span>(<span class=\"pl-s1\">StatsSumCalcInterval</span>)\n\t<span class=\"pl-k\">for</span> <span class=\"pl-k\">range</span> <span class=\"pl-s1\">statsSumTicker</span>.<span class=\"pl-c1\">C</span> {\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[StatsSum Ticker] Start.\"</span>)\n\t\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">storage</span>.<span class=\"pl-c1\">CallProcedureStatsSum</span>(); <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">!=</span> <span class=\"pl-c1\">nil</span> {\n\t\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Printf</span>(<span class=\"pl-s\">\"Error while trying to calculate StatsSum %s\"</span>, <span class=\"pl-s1\">err</span>)\n\t\t}\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[StatsSum Ticker] Finish.\"</span>)\n\t}\n\t<span class=\"pl-k\">return</span> <span class=\"pl-c1\">nil</span>\n}</pre></div>\n<h2 dir=\"auto\">全部访问日志统计处理间隔：30分钟</h2>\n<p dir=\"auto\">所在文件 <code class=\"notranslate\">main.go</code></p>\n<div class=\"highlight highlight-source-go notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"//全部访问日志分析统计的间隔\nStatsIpSumCalcInterval = 30 * time.Minute\n\nfunc startTicker3() error {\n\tstatsIpSumTicker := time.NewTicker(StatsIpSumCalcInterval)\n\tfor range statsIpSumTicker.C {\n\t\tlog.Println(&quot;[StatsIpSum Ticker] Start.&quot;)\n\t\tif err := storage.CallProcedureStatsIPSum(); err != nil {\n\t\t\tlog.Printf(&quot;Error while trying to calculate StatsIpSum %s&quot;, err)\n\t\t}\n\t\tlog.Println(&quot;[StatsIpSum Ticker] Finish.&quot;)\n\t}\n\treturn nil\n}\"><pre class=\"notranslate\"><span class=\"pl-c\">//全部访问日志分析统计的间隔</span>\n<span class=\"pl-s1\">StatsIpSumCalcInterval</span> <span class=\"pl-c1\">=</span> <span class=\"pl-c1\">30</span> <span class=\"pl-c1\">*</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">Minute</span>\n\n<span class=\"pl-k\">func</span> <span class=\"pl-s1\">startTicker3</span>() <span class=\"pl-smi\">error</span> {\n\t<span class=\"pl-s1\">statsIpSumTicker</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">time</span>.<span class=\"pl-c1\">NewTicker</span>(<span class=\"pl-s1\">StatsIpSumCalcInterval</span>)\n\t<span class=\"pl-k\">for</span> <span class=\"pl-k\">range</span> <span class=\"pl-s1\">statsIpSumTicker</span>.<span class=\"pl-c1\">C</span> {\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[StatsIpSum Ticker] Start.\"</span>)\n\t\t<span class=\"pl-k\">if</span> <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">:=</span> <span class=\"pl-s1\">storage</span>.<span class=\"pl-c1\">CallProcedureStatsIPSum</span>(); <span class=\"pl-s1\">err</span> <span class=\"pl-c1\">!=</span> <span class=\"pl-c1\">nil</span> {\n\t\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Printf</span>(<span class=\"pl-s\">\"Error while trying to calculate StatsIpSum %s\"</span>, <span class=\"pl-s1\">err</span>)\n\t\t}\n\t\t<span class=\"pl-s1\">log</span>.<span class=\"pl-c1\">Println</span>(<span class=\"pl-s\">\"[StatsIpSum Ticker] Finish.\"</span>)\n\t}\n\t<span class=\"pl-k\">return</span> <span class=\"pl-c1\">nil</span>\n}</pre></div>\n<h2 dir=\"auto\">License</h2>\n<p dir=\"auto\">ohUrlShortener 以《木兰宽松许可证》 第2版 为开源协议发布</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"Copyright (c) [2023] [巴拉迪维]\n[ohUrlShortener] is licensed under Mulan PSL v2.\nYou can use this software according to the terms and conditions of the Mulan PSL v2.\nYou may obtain a copy of Mulan PSL v2 at:\n         http://license.coscl.org.cn/MulanPSL2\nTHIS SOFTWARE IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OF ANY KIND,\nEITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,\nMERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.\nSee the Mulan PSL v2 for more details.\"><pre class=\"notranslate\"><code class=\"notranslate\">Copyright (c) [2023] [巴拉迪维]\n[ohUrlShortener] is licensed under Mulan PSL v2.\nYou can use this software according to the terms and conditions of the Mulan PSL v2.\nYou may obtain a copy of Mulan PSL v2 at:\n         http://license.coscl.org.cn/MulanPSL2\nTHIS SOFTWARE IS PROVIDED ON AN \"AS IS\" BASIS, WITHOUT WARRANTIES OF ANY KIND,\nEITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,\nMERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.\nSee the Mulan PSL v2 for more details.\n</code></pre></div>\n<h2 dir=\"auto\">Contributor License Agreement</h2>\n<p dir=\"auto\">在 <strong>第一次提交 Pull Request 时</strong> ，请您在 Pull Request 内容中明确写明「本人自愿接受并签署 <a href=\"CLA.md\">《ohUrlShortener Contributor License Agreement》</a>」，并在 Pull Request 信息中附带该协议链接信息。</p>\n<h2 dir=\"auto\">Give Thanks To</h2>\n<p dir=\"auto\">由衷感谢以下开源软件、框架等（包括但不限于）</p>\n<ol dir=\"auto\">\n<li><a href=\"https://github.com/gin-gonic/gin\">gin-gonic/gin</a></li>\n<li><a href=\"https://fomantic-ui.com/\" rel=\"nofollow\">FomanticUI</a></li>\n<li><a href=\"https://github.com/dchest/captcha\">dchest/captcha</a></li>\n<li><a href=\"https://github.com/Masterminds/sprig\">Masterminds/sprig</a></li>\n<li><a href=\"https://github.com/go-redis/redis/\">go-redis/redis</a></li>\n<li><a href=\"https://github.com/jmoiron/sqlx\">jmoiron/sqlx</a></li>\n<li><a href=\"https://github.com/go-ini/ini\">go-ini/ini</a></li>\n</ol>\n<h2 dir=\"auto\">ohUrlShortener</h2>\n<ol dir=\"auto\">\n<li><a href=\"https://www.oschina.net/news/241622/ohurlshortener-2-0-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v2.0 发布，指定「打开方式」功能支持</a></li>\n<li><a href=\"https://www.oschina.net/news/230519/ohurlshortener-1-9-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.9 发布，Redis Cluster 集群支持</a></li>\n<li><a href=\"https://www.oschina.net/news/228559/ohurlshortener-1-8-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.8 发布，API 问题处理</a></li>\n<li><a href=\"https://www.oschina.net/news/211116/ohurlshortener-1-7-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.7 发布，安全更新</a></li>\n<li><a href=\"https://www.oschina.net/news/207439/ohurlshortener-1-6-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.6 发布，统计功能增强</a></li>\n<li><a href=\"https://www.oschina.net/news/200621/ohurlshortener-1-5-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.5 发布，管理功能增强</a></li>\n<li><a href=\"https://www.oschina.net/news/194904/ohurlshortener-1-4-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.4 正式发布</a></li>\n<li><a href=\"https://www.oschina.net/news/193422/ohurlshortener-1-3-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.3 发布，支持导出访问日志</a></li>\n<li><a href=\"https://www.oschina.net/news/190546/ohurlshortener-1-2-released\" rel=\"nofollow\">ohUrlShortener 短链接系统 v1.2 正式发布</a></li>\n<li><a href=\"https://www.oschina.net/news/190168/ohurlshortener-1-0-released\" rel=\"nofollow\">ohUrlShortener 短链接服务系统 1.0 发布</a></li>\n<li>软件信息收录 <a href=\"https://www.oschina.net/p/ohurlshortener\" rel=\"nofollow\">https://www.oschina.net/p/ohurlshortener</a></li>\n<li>Gitee <a href=\"https://gitee.com/barat/ohurlshortener\" rel=\"nofollow\">https://gitee.com/barat/ohurlshortener</a></li>\n<li>Github <a href=\"https://github.com/barats/ohUrlShortener\">https://github.com/barats/ohUrlShortener</a></li>\n<li>Gitlink <a href=\"https://www.gitlink.org.cn/baladiwei/ohurlshortener\" rel=\"nofollow\">https://www.gitlink.org.cn/baladiwei/ohurlshortener</a></li>\n</ol>\n<h2 dir=\"auto\">Stargazers over time</h2>\n<p dir=\"auto\"><a href=\"https://starchart.cc/barats/ohUrlShortener\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/cd1200ee67e0a41269a6b1bd6622a84cb9c9e6a411649c01346689cd547661a3/68747470733a2f2f7374617263686172742e63632f6261726174732f6f6855726c53686f7274656e65722e737667\" alt=\"Stargazers over time\" data-canonical-src=\"https://starchart.cc/barats/ohUrlShortener.svg\" style=\"max-width: 100%;\"></a></p>","updatedAt":"2025-05-21T16:14:06Z","upvoteCount":null,"author":{"login":"eryajf","avatarUrl":"https://avatars.githubusercontent.com/u/33259379?u=e4a4090a38ac2473aaed4ef9945233636776c6c3&v=4","url":"https://github.com/eryajf"},"category":null,"labels":{"edges":[{"node":{"name":"更多","color":"25B472"}},{"node":{"name":"ShortURL","color":"89cbc1"}},{"node":{"name":"barats","color":"befd3f"}}]},"comments":{"edges":[]}}},"pageContext":{"number":410,"previous":{"title":"keyval-dev/odigos: 分布式跟踪，无需更改代码。🚀 使用 OpenTelemetry 和 eBPF 即时监控任何应用程序","number":409},"next":{"title":"CloudWise-OpenSource/omp: 轻量级、聚合型、智能运维管理平台","number":411}}},
    "staticQueryHashes": ["151096407","2861350382"]}