Browse Source

alarmTypeOldName

dev
巴林闲侠 3 years ago
parent
commit
3d1873907a
  1. 1
      api/app/lib/controllers/alarm/app.js
  2. 2
      api/app/lib/controllers/alarm/data.js
  3. 11
      api/app/lib/models/app_inspection.js
  4. 2
      api/sequelize-automate.config.js
  5. 3
      script/0.0.4/schema/1.alert_table.sql

1
api/app/lib/controllers/alarm/app.js

@ -15,6 +15,7 @@ async function inspection (ctx) {
screenshot: s.url, screenshot: s.url,
createTime: now, createTime: now,
description: s.description, description: s.description,
router: s.router
} }
}) })

2
api/app/lib/controllers/alarm/data.js

@ -92,7 +92,7 @@ async function list (ctx) {
${anxinyun}.t_structure.name AS StructureName, ${anxinyun}.t_structure.name AS StructureName,
${anxinyun}.t_alarm_code.name AS AlarmCodeName, ${anxinyun}.t_alarm_code.name AS AlarmCodeName,
AlarmContent, AlarmContent,
${anxinyun}.t_alarm_type.name AS alarmType ${anxinyun}.t_alarm_type.old_name AS alarmTypeOldName
FROM FROM
alarms alarms
LEFT JOIN ${anxinyun}.t_structure LEFT JOIN ${anxinyun}.t_structure

11
api/app/lib/models/app_inspection.js

@ -25,7 +25,7 @@ module.exports = dc => {
autoIncrement: false, autoIncrement: false,
references: { references: {
key: "id", key: "id",
model: "projectApp" model: "app"
} }
}, },
createTime: { createTime: {
@ -72,6 +72,15 @@ module.exports = dc => {
primaryKey: false, primaryKey: false,
field: "description", field: "description",
autoIncrement: false autoIncrement: false
},
router: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "router",
autoIncrement: false
} }
}, { }, {
tableName: "app_inspection", tableName: "app_inspection",

2
api/sequelize-automate.config.js

@ -26,7 +26,7 @@ module.exports = {
dir: './app/lib/models', // 指定输出 models 文件的目录 dir: './app/lib/models', // 指定输出 models 文件的目录
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
tables: ['app_alarm'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 tables: ['app_inspection'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面

3
script/0.0.4/schema/1.alert_table.sql

@ -1,2 +1,5 @@
alter table app_alarm alter table app_alarm
add type varchar(64); add type varchar(64);
alter table app_inspection
add router varchar(1024);

Loading…
Cancel
Save