class NetworkConfigController implements ReactiveServiceCrudController<NetworkConfigEntity, String> {

    private final NetworkConfigService configService;

    private final NetworkManager networkManager;

    private final DataReferenceManager referenceManager;

    private final NetworkChannelProvider channelProvider;

    @Generated
    @Override
    public NetworkConfigService getService() {
        return configService;
    }


    @GetMapping("/{networkType}/_detail")
    @QueryAction
    @Operation(summary = "获取指定类型下全部的网络组件信息")
    public Flux<ChannelInfo> getNetworkInfo(@PathVariable
                                            @Parameter(description = "网络组件类型") String networkType) {
        NetworkProvider<?> provider = networkManager
            .getProvider(networkType)
            .orElseThrow(() -> new I18nSupportException("error.unsupported_network_type", networkType));

        return  configService
            .createQuery()
            .where(NetworkConfigEntity::getType, networkType)
            .orderBy(SortOrder.desc(NetworkConfigEntity::getId))
            .fetch()
            .flatMap(entity -> toConfigInfo(entity, provider));
    }

    /**
     * 获取指定类型下可用的网络组件信息
     * <pre>{@code
     * POST /network/config/{networkType}/_alive?include=
     * }</pre>
     */
    @GetMapping("/{networkType}/_alive")
    @QueryAction
    @QueryOperation(summary = "获取指定类型下可用的网络组件信息")
    public Flux<ChannelInfo> getAliveNetworkInfo(@PathVariable
                                                 @Parameter(description = "网络组件类型") String networkType,
                                                 @Parameter(description = "包含指定的网络组件ID")
                                                 @RequestParam(required = false) String include,
                                                 @Parameter(hidden = true) QueryParamEntity query) {<FILL_FUNCTION_BODY>}

    private Mono<ChannelInfo> toConfigInfo(NetworkConfigEntity entity, NetworkProvider<?> provider) {
        return channelProvider.toChannelInfo(entity);
    }

    @GetMapping("/supports")
    @Operation(summary = "获取支持的网络组件类型")
    public Flux<NetworkTypeInfo> getSupports() {
        return Flux.fromIterable(networkManager.getProviders())
                   .map(NetworkProvider::getType)
                   .map(NetworkTypeInfo::of);
    }

    @PostMapping("/{id}/_start")
    @SaveAction
    @Operation(summary = "启动网络组件")
    public Mono<Void> start(@PathVariable
                            @Parameter(description = "网络组件ID") String id) {
        return configService.start(id);
    }

    @PostMapping("/{id}/_shutdown")
    @SaveAction
    @Operation(summary = "停止网络组件")
    public Mono<Void> shutdown(@PathVariable
                               @Parameter(description = "网络组件ID") String id) {
        return configService.shutdown(id);
    }

}

        NetworkProvider<?> provider = networkManager
            .getProvider(networkType)
            .orElseThrow(() -> new I18nSupportException("error.unsupported_network_type", networkType));

        return configService
            .createQuery()
            .setParam(query)
            .where(NetworkConfigEntity::getType, networkType)
            .and(NetworkConfigEntity::getState, NetworkConfigState.enabled)
            .orderBy(SortOrder.desc(NetworkConfigEntity::getId))
            .fetch()
            .filterWhen(config -> {
                if (provider.isReusable() || Objects.equals(config.getId(), include)) {
                    return Mono.just(true);
                }
                //判断是否已经被使用
                return referenceManager
                    .isReferenced(DataReferenceManager.TYPE_NETWORK, config.getId())
                    .as(BooleanUtils::not);
            })
            .flatMap(entity -> toConfigInfo(entity, provider));
    
<no_super_class>