feat(国际化): 新增国际化

This commit is contained in:
gx_ma
2026-03-24 11:41:41 +08:00
parent abe46baf18
commit e70c198071
97 changed files with 10802 additions and 5302 deletions

View File

@@ -392,7 +392,7 @@ public class GenTableServiceImpl implements IGenTableService
}
catch (IOException e)
{
throw new ServiceException("渲染模板失败,表名:" + table.getTableName());
throw new ServiceException(MessageUtils.message("genTable.template.rendering.fail", table.getTableName()));
}
}
}
@@ -414,7 +414,7 @@ public class GenTableServiceImpl implements IGenTableService
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
if (StringUtils.isEmpty(dbTableColumns))
{
throw new ServiceException("同步数据失败,原表结构不存在");
throw new ServiceException(MessageUtils.message("genTable.data.sync.fail.original.table.not.exist"));
}
List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
@@ -526,25 +526,25 @@ public class GenTableServiceImpl implements IGenTableService
JSONObject paramsObj = JSON.parseObject(options);
if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_CODE)))
{
throw new ServiceException("树编码字段不能为空");
throw new ServiceException(MessageUtils.message("genTable.tree.code.field.cannot.empty"));
}
else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_PARENT_CODE)))
{
throw new ServiceException("树父编码字段不能为空");
throw new ServiceException(MessageUtils.message("genTable.tree.parent.code.field.cannot.empty"));
}
else if (StringUtils.isEmpty(paramsObj.getString(GenConstants.TREE_NAME)))
{
throw new ServiceException("树名称字段不能为空");
throw new ServiceException(MessageUtils.message("genTable.tree.name.field.cannot.empty"));
}
else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
{
if (StringUtils.isEmpty(genTable.getSubTableName()))
{
throw new ServiceException("关联子表的表名不能为空");
throw new ServiceException(MessageUtils.message("genTable.relate.child.table.name.cannot.empty"));
}
else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
{
throw new ServiceException("子表关联的外键名不能为空");
throw new ServiceException(MessageUtils.message("genTable.child.table.relate.foreign.key.name.cannot.empty"));
}
}
}

View File

@@ -3,6 +3,7 @@ package com.fastbee.mqttclient;
import com.fastbee.common.constant.FastBeeConstant;
import com.fastbee.common.core.redis.RedisCache;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.MessageUtils;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.*;
@@ -120,7 +121,7 @@ public class PubMqttClient {
token.waitForCompletion();
} catch (MqttException e) {
log.error("=>断开mqtt连接发生错误 message={}", e.getMessage());
throw new ServiceException("断开mqtt连接发生错误" + e.getMessage());
throw new ServiceException(MessageUtils.message("mqtt.disconnect.occur.fail", e.getMessage()));
}
}
client = null;