Browse Source

AlarmPushConfig

dev
巴林闲侠 3 years ago
parent
commit
8060cfff8a
  1. 2
      api/app/lib/controllers/push/config.js
  2. 6
      api/app/lib/index.js

2
api/app/lib/controllers/push/config.js

@ -22,7 +22,7 @@ async function list (ctx) {
if (keywordTarget == 'tactics') {
findOption.where.name = { $like: `%${keyword}%` }
} else if (keywordTarget == 'struc') {
let bindAnixinStrucRes = await clickHouse.anxinyun.query(`
let bindAnixinStrucRes = await clickHouse.projectManage.query(`
SELECT id, name FROM t_structure
WHERE name LIKE '%${keyword}%'
`).toPromise()

6
api/app/lib/index.js

@ -58,7 +58,8 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
});
const {
AppInspection, ProjectApp, ProjectCorrelation, AppAlarm, App, AlarmAppearRecord, AlarmConfirmLog, EmailSendLog, LatestDynamicList
AppInspection, ProjectApp, ProjectCorrelation, AppAlarm, App, AlarmAppearRecord, AlarmConfirmLog, EmailSendLog, LatestDynamicList,
AlarmPushConfig
} = dc.models;
AppInspection.belongsTo(App, { foreignKey: 'projectAppId', targetKey: 'id' });
@ -77,7 +78,8 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
AppAlarm.belongsTo(App, { foreignKey: 'projectAppId', targetKey: 'id' });
App.hasMany(AppAlarm, { foreignKey: 'projectAppId', sourceKey: 'id' });
AlarmPushConfig.belongsTo(ProjectCorrelation, { foreignKey: 'pomsProjectId', targetKey: 'id' });
ProjectCorrelation.hasMany(AlarmPushConfig, { foreignKey: 'pomsProjectId', sourceKey: 'id' });
AlarmAppearRecord.belongsTo(ProjectCorrelation, { foreignKey: 'projectCorrelationId', targetKey: 'id' });
ProjectCorrelation.hasMany(AlarmAppearRecord, { foreignKey: 'projectCorrelationId', sourceKey: 'id' });

Loading…
Cancel
Save