PluginController.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:iotplatform 作者:
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
@RequestMapping(value = "/plugin/{pluginId}", method = RequestMethod.DELETE)
@ResponseStatus(value = HttpStatus.OK)
public void deletePlugin(@PathVariable("pluginId") String strPluginId) throws IoTPException {
    checkParameter("pluginId", strPluginId);
    try {
        PluginId pluginId = new PluginId(toUUID(strPluginId));
        PluginMetaData plugin = checkPlugin(pluginService.findPluginById(pluginId));
        pluginService.deletePluginById(pluginId);
        //actorService.onPluginStateChange(plugin.getTenantId(), plugin.getId(), ComponentLifecycleEvent.DELETED);
        JsonObject json = new JsonObject();
        json.addProperty(ThingsMetaKafkaTopics.TENANT_ID, plugin.getTenantId().toString());
        json.addProperty(ThingsMetaKafkaTopics.PLUGIN_ID, plugin.getId().toString());
        json.addProperty(ThingsMetaKafkaTopics.EVENT, ComponentLifecycleEvent.DELETED.name());
        msgProducer.send(ThingsMetaKafkaTopics.METADATA_PLUGIN_TOPIC, plugin.getId().toString(), json.toString());
    } catch (Exception e) {
        throw handleException(e);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号