mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-10 17:30:27 +08:00
增加检查端口是否使用接口
This commit is contained in:
@@ -14,7 +14,7 @@ type ServerDAO struct {
|
||||
}
|
||||
|
||||
// 查找服务配置
|
||||
func (this *ServerDAO) FindServerConfig(ctx context.Context, serverId int64) (*serverconfigs.ServerConfig, error) {
|
||||
func (this *ServerDAO) FindEnabledServerConfig(ctx context.Context, serverId int64) (*serverconfigs.ServerConfig, error) {
|
||||
resp, err := this.RPC().ServerRPC().FindEnabledServerConfig(ctx, &pb.FindEnabledServerConfigRequest{ServerId: serverId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -29,3 +29,12 @@ func (this *ServerDAO) FindServerConfig(ctx context.Context, serverId int64) (*s
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// 查找服务
|
||||
func (this *ServerDAO) FindEnabledServer(ctx context.Context, serverId int64) (*pb.Server, error) {
|
||||
resp, err := this.RPC().ServerRPC().FindEnabledServer(ctx, &pb.FindEnabledServerRequest{ServerId: serverId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.Server, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user