master
2022-04-20 09f5baff0d14f593b52920b9b76d46fedfb753a8
配置文件上传组件
5个文件已修改
1个文件已删除
3个文件已添加
80 ■■■■■ 已修改文件
package.json 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/uploads/20220322/b727cf90-a9bf-11ec-acb4-a3b8bbe5799b.gif 补丁 | 查看 | 原始文档 | blame | 历史
public/uploads/20220420/53bfc470-c086-11ec-bb98-e949bbebdc44.docx 补丁 | 查看 | 原始文档 | blame | 历史
src/app/modules/business/controller/admin/alram.ts 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/app/modules/business/entity/alarm.ts 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/app/modules/business/entity/modelstatic.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/app/modules/business/service/deviceinfo.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/config/config.default.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/configuration.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -7,6 +7,7 @@
    "@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",
public/uploads/20220322/b727cf90-a9bf-11ec-acb4-a3b8bbe5799b.gif
Binary files differ
public/uploads/20220420/53bfc470-c086-11ec-bb98-e949bbebdc44.docx
Binary files differ
src/app/modules/business/controller/admin/alram.ts
New file
@@ -0,0 +1,17 @@
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 {
}
src/app/modules/business/entity/alarm.ts
New file
@@ -0,0 +1,25 @@
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;
}
src/app/modules/business/entity/modelstatic.ts
@@ -27,6 +27,18 @@
  @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;
src/app/modules/business/service/deviceinfo.ts
@@ -18,13 +18,13 @@
  /**
   * 描述
   */
  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) {
src/config/config.default.ts
@@ -1,6 +1,7 @@
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>;
@@ -46,7 +47,7 @@
      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 = {
@@ -73,7 +74,8 @@
    // 文件上传
    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;
src/configuration.ts
@@ -38,13 +38,14 @@
    // alipay,
    // socket
    //socket,
    // file,
  ],
})
export class ContainerLifeCycle implements ILifeCycle {
  @App()
  app: Application;
  // 应用启动完成
  async onReady(container?: IMidwayContainer) {}
  async onReady(container?: IMidwayContainer) { }
  // 应用停止
  async onStop() {}
  async onStop() { }
}