From 09f5baff0d14f593b52920b9b76d46fedfb753a8 Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期三, 20 四月 2022 16:53:46 +0800
Subject: [PATCH] 配置文件上传组件
---
/dev/null | 0
public/uploads/20220420/53bfc470-c086-11ec-bb98-e949bbebdc44.docx | 0
src/app/modules/business/entity/alarm.ts | 25 ++++++++++++
src/app/modules/business/service/deviceinfo.ts | 14 +++---
src/configuration.ts | 5 +-
package.json | 1
src/app/modules/business/controller/admin/alram.ts | 17 ++++++++
src/app/modules/business/entity/modelstatic.ts | 12 ++++++
src/config/config.default.ts | 6 ++-
9 files changed, 69 insertions(+), 11 deletions(-)
diff --git a/package.json b/package.json
index 2b82e94..e4ff29d 100644
--- a/package.json
+++ b/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",
diff --git a/public/uploads/20220322/b727cf90-a9bf-11ec-acb4-a3b8bbe5799b.gif b/public/uploads/20220322/b727cf90-a9bf-11ec-acb4-a3b8bbe5799b.gif
deleted file mode 100644
index d0f6891..0000000
--- a/public/uploads/20220322/b727cf90-a9bf-11ec-acb4-a3b8bbe5799b.gif
+++ /dev/null
Binary files differ
diff --git a/public/uploads/20220420/53bfc470-c086-11ec-bb98-e949bbebdc44.docx b/public/uploads/20220420/53bfc470-c086-11ec-bb98-e949bbebdc44.docx
new file mode 100644
index 0000000..6d16a59
--- /dev/null
+++ b/public/uploads/20220420/53bfc470-c086-11ec-bb98-e949bbebdc44.docx
Binary files differ
diff --git a/src/app/modules/business/controller/admin/alram.ts b/src/app/modules/business/controller/admin/alram.ts
new file mode 100644
index 0000000..0f8d108
--- /dev/null
+++ b/src/app/modules/business/controller/admin/alram.ts
@@ -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 {
+
+
+}
\ No newline at end of file
diff --git a/src/app/modules/business/entity/alarm.ts b/src/app/modules/business/entity/alarm.ts
new file mode 100644
index 0000000..f381e8d
--- /dev/null
+++ b/src/app/modules/business/entity/alarm.ts
@@ -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;
+
+}
\ No newline at end of file
diff --git a/src/app/modules/business/entity/modelstatic.ts b/src/app/modules/business/entity/modelstatic.ts
index 9803a5b..65f040d 100644
--- a/src/app/modules/business/entity/modelstatic.ts
+++ b/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;
diff --git a/src/app/modules/business/service/deviceinfo.ts b/src/app/modules/business/service/deviceinfo.ts
index 5f54180..8695d6a 100644
--- a/src/app/modules/business/service/deviceinfo.ts
+++ b/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) {
diff --git a/src/config/config.default.ts b/src/config/config.default.ts
index 94bd5cc..c9c4d15 100644
--- a/src/config/config.default.ts
+++ b/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;
diff --git a/src/configuration.ts b/src/configuration.ts
index bd3298e..ed46ab5 100644
--- a/src/configuration.ts
+++ b/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() { }
}
--
Gitblit v1.9.1