class DeviceProductHandler {

    private final LocalDeviceProductService productService;

    private final DeviceRegistry deviceRegistry;

    private final ApplicationEventPublisher eventPublisher;

    @EventListener
    public void handleProductSaveEvent(EntitySavedEvent<DeviceProductEntity> event) {
        event.async(
            applyProductConfig(event.getEntity())
        );
    }

    @EventListener
    public void handleProductSaveEvent(EntityModifyEvent<DeviceProductEntity> event) {
        event.async(
            applyProductConfig(event.getBefore())
        );
    }

    //已发布状态的产品配置更新后，重新应用配置
    private Mono<Void> applyProductConfig(List<DeviceProductEntity> entities) {<FILL_FUNCTION_BODY>}
}

        return Flux
            .fromIterable(entities)
            .map(DeviceProductEntity::getId)
            .as(productService::findById)
            .filter(product -> product.getState() == 1)
            .flatMap(product -> deviceRegistry
                .register(product.toProductInfo())
                .flatMap(i -> FastBeanCopier
                    .copy(product, new DeviceProductDeployEvent())
                    .publish(eventPublisher))
            )
            .then();
    
<no_super_class>