修改原有框架中英文映射

This commit is contained in:
2026-03-17 18:09:10 +08:00
parent e7b8f4cae9
commit bdf50e61f5
81 changed files with 1956 additions and 735 deletions

View File

@@ -50,7 +50,7 @@ class CrontabLogic extends BaseLogic
6 => "0 {$minute} {$hour} * * {$week}",
7 => "0 {$minute} {$hour} {$day} * *",
8 => "0 {$minute} {$hour} {$day} {$month} *",
default => throw new ApiException("任务类型异常"),
default => throw new ApiException('Invalid task type'),
};
// 定时任务模型新增
@@ -95,13 +95,13 @@ class CrontabLogic extends BaseLogic
6 => "0 {$minute} {$hour} * * {$week}",
7 => "0 {$minute} {$hour} {$day} * *",
8 => "0 {$minute} {$hour} {$day} {$month} *",
default => throw new ApiException("任务类型异常"),
default => throw new ApiException('Invalid task type'),
};
// 查询任务数据
$model = $this->model->findOrEmpty($id);
if ($model->isEmpty()) {
throw new ApiException('数据不存在');
throw new ApiException('Data not found');
}
$result = $model->save([
@@ -134,7 +134,7 @@ class CrontabLogic extends BaseLogic
{
if (is_array($ids)) {
if (count($ids) > 1) {
throw new ApiException('禁止批量删除操作');
throw new ApiException('Batch delete is not allowed');
}
$ids = $ids[0];
}
@@ -157,7 +157,7 @@ class CrontabLogic extends BaseLogic
{
$model = $this->model->findOrEmpty($id);
if ($model->isEmpty()) {
throw new ApiException('数据不存在');
throw new ApiException('Data not found');
}
$result = $model->save(['status' => $status]);
if ($result) {

View File

@@ -63,7 +63,7 @@ class GenerateTablesLogic extends BaseLogic
$data = config('think-orm.connections');
$config = $data[$source];
if (!$config) {
throw new ApiException('数据库配置读取失败');
throw new ApiException('Failed to read database config');
}
$prefix = $config['prefix'] ?? '';
@@ -262,10 +262,10 @@ class GenerateTablesLogic extends BaseLogic
{
$table = $this->model->findOrEmpty($id);
if (!in_array($table['template'], ["plugin", "app"])) {
throw new ApiException('应用类型必须为plugin或者app');
throw new ApiException('App type must be plugin or app');
}
if (empty($table['namespace'])) {
throw new ApiException('请先设置应用名称');
throw new ApiException('Please set app name first');
}
$columns = $this->columnLogic->where('table_id', $id)
@@ -320,11 +320,11 @@ class GenerateTablesLogic extends BaseLogic
{
$table = $this->model->where('id', $id)->findOrEmpty();
if ($table->isEmpty()) {
throw new ApiException('请选择要生成的表');
throw new ApiException('Please select tables to generate');
}
$debug = config('app.debug', true);
if (!$debug) {
throw new ApiException('非调试模式下,不允许生成文件');
throw new ApiException('File generation not allowed in non-debug mode');
}
$this->updateMenu($table);
$this->genModule($id);