| | |
| | | "@cool-midway/alipay": "^4.0.4", |
| | | "@cool-midway/core": "^4.0.16", |
| | | "@cool-midway/es": "^4.0.2", |
| | | "@cool-midway/file": "^5.0.3", |
| | | "@cool-midway/oss": "^4.0.3", |
| | | "@cool-midway/queue": "^4.1.2", |
| | | "@cool-midway/redis": "^4.0.5", |
| New file |
| | |
| | | import { ALL, Body, Get, Inject, Post, Provide, Query } from '@midwayjs/decorator'; |
| | | import { CoolController, BaseController } from '@cool-midway/core'; |
| | | import { AlarmEntity } from '../../entity/alarm'; |
| | | // import { ColletdataService } from '../../service/colletdata'; |
| | | import { DataController } from '../../../base/controller/dataController'; |
| | | /** |
| | | * 监测元数据 |
| | | */ |
| | | @Provide() |
| | | @CoolController({ |
| | | api: ['add', 'delete', 'update', 'list', 'page', 'info'], |
| | | entity: AlarmEntity, |
| | | }) |
| | | export class AlarmController extends DataController { |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | import { EntityModel } from '@midwayjs/orm'; |
| | | import { BaseEntity } from '@cool-midway/core'; |
| | | import { Column, Double } from 'typeorm'; |
| | | /** |
| | | * 设备信息 |
| | | */ |
| | | @EntityModel('t_sys_alarm') |
| | | export class AlarmEntity extends BaseEntity { |
| | | @Column({ comment: '告警类别', type: 'varchar', default: '', length: 50 }) |
| | | alarm_type: string; |
| | | |
| | | @Column({ comment: '汇报时间', type: 'varchar', default: '', length: 50 }) |
| | | report_time: string; |
| | | |
| | | @Column({ comment: '汇报内容', type: 'varchar', default: '', length: 50 }) |
| | | report_content: string; |
| | | |
| | | |
| | | @Column({ comment: '{name:"备注"}', type: 'varchar', default: '', length: 50 }) |
| | | remark: string; |
| | | |
| | | @Column({ comment: '{name:"状态",dict:{"1":"启用", "0":"停用"}}', type: 'int', default: 1, width: 0 }) |
| | | status: number; |
| | | |
| | | } |
| | |
| | | @Column({ comment: '高度', type: 'varchar', default: '', length: 50 }) |
| | | height: string; |
| | | |
| | | @Column({ comment: '旋转角', type: 'varchar', default: '', length: 50 }) |
| | | heading: string; |
| | | |
| | | @Column({ comment: '俯仰角', type: 'varchar', default: '', length: 50 }) |
| | | peatch: string; |
| | | |
| | | @Column({ comment: '翻滚角', type: 'varchar', default: '', length: 50 }) |
| | | roll: string; |
| | | |
| | | @Column({ comment: '缩放比例', type: 'varchar', default: '', length: 50 }) |
| | | scale: string; |
| | | |
| | | @Column({ comment: '{name:"备注"}', type: 'varchar', default: '', length: 50 }) |
| | | remark: string; |
| | | |
| | |
| | | /** |
| | | * 描述 |
| | | */ |
| | | async add(param: any) { |
| | | console.log(param, "dddddddd") |
| | | const { logic_id } = param |
| | | const devicegroup = this.Devicegroup |
| | | await this.Devicegroup.insert(param) |
| | | return await super.add(param) |
| | | } |
| | | // async add(param: any) { |
| | | // console.log(param, "dddddddd") |
| | | // const { logic_id } = param |
| | | // const devicegroup = this.Devicegroup |
| | | // await this.Devicegroup.insert(param) |
| | | // return await super.add(param) |
| | | // } |
| | | |
| | | |
| | | async delete(logic_id: any) { |
| | |
| | | import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg'; |
| | | import { CoolConfig } from '@cool-midway/core'; |
| | | import * as path from 'path'; |
| | | import { CoolFileConfig, MODETYPE } from '@cool-midway/file'; |
| | | |
| | | export type DefaultConfig = PowerPartial<EggAppConfig>; |
| | | |
| | |
| | | enable: false, |
| | | ignoreJSON: true, |
| | | }, |
| | | domainWhiteList: ['http://localhost:9100', 'http://192.168.1.4:9100'], |
| | | domainWhiteList: ['http://localhost:9100', 'http://192.168.1.4:9100', 'http://112.74.77.127:9100'], |
| | | }; |
| | | |
| | | config.cors = { |
| | |
| | | // 文件上传 |
| | | file: { |
| | | // 文件路径前缀 本地上传模式下 有效 |
| | | domain: 'http://127.0.0.1:8001', |
| | | // domain: 'http://127.0.0.1:8001', |
| | | domain: 'http://112.74.77.127:9100/hn', |
| | | }, |
| | | } as CoolConfig; |
| | | |
| | |
| | | // alipay, |
| | | // socket |
| | | //socket, |
| | | // file, |
| | | ], |
| | | }) |
| | | export class ContainerLifeCycle implements ILifeCycle { |
| | | @App() |
| | | app: Application; |
| | | // 应用启动完成 |
| | | async onReady(container?: IMidwayContainer) {} |
| | | async onReady(container?: IMidwayContainer) { } |
| | | // 应用停止 |
| | | async onStop() {} |
| | | async onStop() { } |
| | | } |