mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-05-07 08:14:39 +08:00
feat(国际化): 新增国际化
This commit is contained in:
@@ -2,6 +2,7 @@ package com.fastbee.common;
|
||||
|
||||
import com.fastbee.common.core.iot.response.DeCodeBo;
|
||||
import com.fastbee.common.exception.ServiceException;
|
||||
import com.fastbee.common.utils.MessageUtils;
|
||||
import com.fastbee.common.utils.gateway.CRC16Utils;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -21,7 +22,7 @@ public class ProtocolDeCodeService {
|
||||
|
||||
public String protocolDeCode(DeCodeBo bo) {
|
||||
if (null == bo) {
|
||||
throw new ServiceException("输入内容为空");
|
||||
throw new ServiceException(MessageUtils.message("protocol.input.content.is.empty"));
|
||||
}
|
||||
String payload = bo.getPayload();
|
||||
/*1-解析 2-读指令 3-写指令 4-CRC生成 5-CRC校验*/
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.fastbee.common.core.thingsModel.ThingsModelSimpleItem;
|
||||
import com.fastbee.common.core.thingsModel.ThingsModelValuesInput;
|
||||
import com.fastbee.common.exception.ServiceException;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.common.utils.MessageUtils;
|
||||
import com.fastbee.iot.model.ThingsModels.ValueItem;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -45,7 +46,7 @@ public class JsonProtocolService {
|
||||
reportMessage.setSerialNumber(clientId);
|
||||
return reportMessage;
|
||||
}catch (Exception e){
|
||||
throw new ServiceException("数据解析异常"+e.getMessage());
|
||||
throw new ServiceException(MessageUtils.message("protocol.data.parse.exception", e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user