From ac7ab51dbbd22b870085fd9a1cee56a4353e6118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 26 Jul 2022 11:15:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BDDNS=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=AD=E5=9B=BD=E9=A6=99=E6=B8=AF=E3=80=81=E4=B8=AD=E5=9B=BD?= =?UTF-8?q?=E6=BE=B3=E9=97=A8=E3=80=81=E4=B8=AD=E5=9B=BD=E5=8F=B0=E6=B9=BE?= =?UTF-8?q?=E3=80=81=E4=B8=AD=E5=9B=BD=E5=A4=A7=E9=99=86=E3=80=81=E6=B5=B7?= =?UTF-8?q?=E5=A4=96=E7=AD=89=E7=BA=BF=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/dnsconfigs/routes.go | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/pkg/dnsconfigs/routes.go b/pkg/dnsconfigs/routes.go index fd7c649..182bdc0 100644 --- a/pkg/dnsconfigs/routes.go +++ b/pkg/dnsconfigs/routes.go @@ -2,6 +2,8 @@ package dnsconfigs +type RouteCode = string + type Route struct { Name string `json:"name"` Code string `json:"code"` @@ -105,6 +107,12 @@ var AllDefaultISPRoutes = []*Route{ }, } +const ( + ChinaProvinceCodeHK RouteCode = "china:province:hk" + ChinaProvinceCodeMO RouteCode = "china:province:mo" + ChinaProvinceCodeTW RouteCode = "china:province:tw" +) + // AllDefaultChinaProvinceRoutes 中国地域线路 var AllDefaultChinaProvinceRoutes = []*Route{ { @@ -264,29 +272,63 @@ var AllDefaultChinaProvinceRoutes = []*Route{ }, { Name: "香港特别行政区", - Code: "china:province:hk", + Code: ChinaProvinceCodeHK, AliasNames: []string{"香港特别行政区", "香港"}, }, { Name: "澳门特别行政区", - Code: "china:province:mo", + Code: ChinaProvinceCodeMO, AliasNames: []string{"澳门特别行政区", "澳门"}, }, { Name: "台湾省", - Code: "china:province:tw", + Code: ChinaProvinceCodeTW, AliasNames: []string{"台湾省", "台湾"}, }, } +const ( + WorldRegionCodeChina RouteCode = "world:CN" + WorldRegionCodeHK RouteCode = "world:CN:hk" + WorldRegionCodeMO RouteCode = "world:CN:mo" + WorldRegionCodeTW RouteCode = "world:CN:tw" + WorldRegionCodeChinaMainland RouteCode = "world:CN:mainland" + WorldRegionCodeChinaAbroad RouteCode = "world:CN:abroad" +) + // AllDefaultWorldRegionRoutes 世界地域线路 // 参考:https://zh.wikipedia.org/wiki/%E5%9C%8B%E5%AE%B6%E5%9C%B0%E5%8D%80%E4%BB%A3%E7%A2%BC var AllDefaultWorldRegionRoutes = []*Route{ { - Name: "中国", - Code: "world:CN", + Name: "中国全境", + Code: WorldRegionCodeChina, AliasNames: []string{"中国"}, }, + { + Name: "中国香港", + Code: WorldRegionCodeHK, + AliasNames: []string{"中国香港地区"}, + }, + { + Name: "中国澳门", + Code: WorldRegionCodeMO, + AliasNames: []string{"中国澳门地区"}, + }, + { + Name: "中国台湾", + Code: WorldRegionCodeTW, + AliasNames: []string{"中国台湾地区"}, + }, + { + Name: "中国大陆", + Code: WorldRegionCodeChinaMainland, + AliasNames: []string{"中国大陆大区"}, + }, + { + Name: "海外", + Code: WorldRegionCodeChinaAbroad, + AliasNames: []string{"中国海外地区"}, + }, { Name: "蒙古", Code: "world:MN",