mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-10 04:00:24 +08:00
智能DNS初步支持搜索引擎线路
This commit is contained in:
@@ -206,6 +206,23 @@ func (this *EdgeDNSAPIProvider) GetRoutes(domain string) (routes []*dnstypes.Rou
|
||||
}
|
||||
}
|
||||
|
||||
// Agent
|
||||
{
|
||||
var routesResp = &edgeapi.FindAllNSRoutesResponse{}
|
||||
err = this.doAPI("/NSRouteService/FindAllAgentNSRoutes", map[string]any{}, routesResp)
|
||||
if err != nil {
|
||||
// 忽略错误,因为老版本的EdgeDNS没有提供这个接口
|
||||
err = nil
|
||||
} else {
|
||||
for _, route := range routesResp.Data.NSRoutes {
|
||||
routes = append(routes, &dnstypes.Route{
|
||||
Name: route.Name,
|
||||
Code: route.Code,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义
|
||||
{
|
||||
var routesResp = &edgeapi.FindAllNSRoutesResponse{}
|
||||
|
||||
Reference in New Issue
Block a user