Commit 8fc446ab authored by 赵啸非's avatar 赵啸非

日志展示修改

parent 054521b9
...@@ -74,7 +74,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -74,7 +74,7 @@ public class MessageServiceImpl implements MessageService {
@Override @Override
public void send(TopicPartitionInfo info, TbQueueMsgHeaders header, String message, TbQueueCallback callback) { public void send(TopicPartitionInfo info, TbQueueMsgHeaders header, String message, TbQueueCallback callback) {
TbQueueProducer<TbQueueMsg> producer = producerProvider.getTbCoreMsgProducer(); TbQueueProducer<TbQueueMsg> producer = producerProvider.getTbCoreMsgProducer();
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), message == null ? "" : message, header); TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastSimpleUUID(), message == null ? "" : message, header);
producer.send(info, queueMsg, callback); producer.send(info, queueMsg, callback);
} }
......
package com.mortals.xhx.module.device.service.impl; package com.mortals.xhx.module.device.service.impl;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -12,20 +13,25 @@ import com.mortals.xhx.module.device.service.DeviceLogService; ...@@ -12,20 +13,25 @@ import com.mortals.xhx.module.device.service.DeviceLogService;
import java.util.List; import java.util.List;
/** /**
* DeviceLogService * DeviceLogService
* 设备日志 service实现 * 设备日志 service实现
* *
* @author zxfei * @author zxfei
* @date 2022-06-27 * @date 2022-06-27
*/ */
@Service("deviceLogService") @Service("deviceLogService")
public class DeviceLogServiceImpl extends AbstractCRUDServiceImpl<DeviceLogDao, DeviceLogEntity, Long> implements DeviceLogService { public class DeviceLogServiceImpl extends AbstractCRUDServiceImpl<DeviceLogDao, DeviceLogEntity, Long> implements DeviceLogService {
@Override @Override
protected void findAfter(DeviceLogEntity params, PageInfo pageInfo, Context context, List<DeviceLogEntity> list) throws AppException { protected void findAfter(DeviceLogEntity params, PageInfo pageInfo, Context context, List<DeviceLogEntity> list) throws AppException {
list.stream().forEach(item->{ list.stream().forEach(item -> {
item.setContent(Base64.decodeStr(item.getContent())); try {
item.setContent(Base64.decodeStr(item.getContent()));
} catch (Exception e) {
log.error("content:" + item.getContent());
}
}); });
} }
} }
\ No newline at end of file
...@@ -52,4 +52,10 @@ public class DeviceLogController extends BaseCRUDJsonBodyMappingController<Devic ...@@ -52,4 +52,10 @@ public class DeviceLogController extends BaseCRUDJsonBodyMappingController<Devic
entity.setContent(Base64.decodeStr(entity.getContent())); entity.setContent(Base64.decodeStr(entity.getContent()));
return super.viewAfter(id, model, entity, context); return super.viewAfter(id, model, entity, context);
} }
public static void main(String[] args) {
String en="eyJ3YWl0Y291bnQiOiIzIiwiZm9yd2FpdGNvdW50IjoiMCJ9";
System.out.println(Base64.decodeStr(en));
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment