class DeviceGatewayService extends GenericReactiveCrudService<DeviceGatewayEntity, String> {

    public Mono<Integer> updateState(String id, DeviceGatewayState state) {
        return createUpdate()
            .where()
            .and(DeviceGatewayEntity::getId, id)
            .set(DeviceGatewayEntity::getState, state)
            .set(DeviceGatewayEntity::getStateTime, System.currentTimeMillis())
            .execute()
            .contextWrite(Context.of(DO_NOT_RELOAD_GATEWAY, true));
    }


    @Override
    public Mono<Integer> deleteById(Publisher<String> idPublisher) {<FILL_FUNCTION_BODY>}
}

        return this
            .findById(Flux.from(idPublisher))
            .switchIfEmpty(Mono.error(new NotFoundException("error.device_gateway_not_exist")))
            .doOnNext(deviceGatewayEntity -> {
                if (DeviceGatewayState.enabled.equals(deviceGatewayEntity.getState())) {
                    throw new UnsupportedOperationException("error.device_gateway_enabled");
                }
            })
            .map(DeviceGatewayEntity::getId)
            .as(super::deleteById);
    
<no_super_class>