增加城市/ISP查询接口

This commit is contained in:
刘祥超
2022-01-06 16:25:23 +08:00
parent e7b0f0df90
commit d35db163ae
12 changed files with 251 additions and 31 deletions

View File

@@ -102,6 +102,11 @@ func (this *BaseService) ValidateAuthorityNode(ctx context.Context) (nodeId int6
// ValidateNodeId 获取节点ID
func (this *BaseService) ValidateNodeId(ctx context.Context, roles ...rpcutils.UserType) (role rpcutils.UserType, nodeIntId int64, err error) {
// 默认包含大部分节点
if len(roles) == 0 {
roles = []rpcutils.UserType{rpcutils.UserTypeNode, rpcutils.UserTypeCluster, rpcutils.UserTypeAdmin, rpcutils.UserTypeUser, rpcutils.UserTypeDNS, rpcutils.UserTypeReport, rpcutils.UserTypeMonitor, rpcutils.UserTypeLog}
}
if ctx == nil {
err = errors.New("context should not be nil")
role = rpcutils.UserTypeNone