增加检查端口是否使用接口

This commit is contained in:
刘祥超
2021-01-27 11:54:02 +08:00
parent fc4daa74bd
commit 503e702dd7
3 changed files with 494 additions and 262 deletions

View File

@@ -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
}