From ea91d26a2c90e8f70b6433b32a78aa840e501c58 Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期二, 08 三月 2022 14:55:10 +0800
Subject: [PATCH] 新增设备分组接口
---
src/app/modules/deviceGroup/controller/admin/deviceGroup.ts | 13 ++++
src/app/modules/taskSetting/controller/admin/taskSetting.ts | 13 ++++
src/app/modules/taskSetting/controller/app/taskSetting.ts | 15 +++++
src/app/modules/taskSetting/entity/taskSetting.ts | 42 ++++++++++++++
src/app/modules/deviceGroup/entity/deviceGroup.ts | 24 ++++++++
src/app/modules/taskSetting/config.ts | 16 +++++
src/app/modules/deviceGroup/config.ts | 16 +++++
src/app/modules/deviceGroup/controller/app/deviceGroup.ts | 15 +++++
8 files changed, 154 insertions(+), 0 deletions(-)
diff --git a/src/app/modules/deviceGroup/config.ts b/src/app/modules/deviceGroup/config.ts
new file mode 100644
index 0000000..a5c55ad
--- /dev/null
+++ b/src/app/modules/deviceGroup/config.ts
@@ -0,0 +1,16 @@
+import { Application } from 'egg';
+import { ModuleConfig } from '@cool-midway/core';
+
+/**
+ * 妯″潡閰嶇疆
+ */
+export default (app: Application) => {
+ return {
+ // 妯″潡鍚嶇О
+ name: 'deviceGroup',
+ // 妯″潡鎻忚堪
+ description: '璁惧鍒嗙粍',
+ // 涓棿浠讹紝鍙鏈ā鍧楁湁鏁�
+ middlewares: [],
+ } as ModuleConfig;
+};
\ No newline at end of file
diff --git a/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts b/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts
new file mode 100644
index 0000000..20bd12f
--- /dev/null
+++ b/src/app/modules/deviceGroup/controller/admin/deviceGroup.ts
@@ -0,0 +1,13 @@
+import { Provide } from '@midwayjs/decorator';
+import { CoolController, BaseController } from '@cool-midway/core';
+import { DemodeviceGroupEntity } from '../../entity/deviceGroup';
+
+/**
+ * 鎻忚堪
+ */
+@Provide()
+@CoolController({
+ api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+ entity: DemodeviceGroupEntity,
+})
+export class DemoAdmindeviceGroupController extends BaseController { }
diff --git a/src/app/modules/deviceGroup/controller/app/deviceGroup.ts b/src/app/modules/deviceGroup/controller/app/deviceGroup.ts
new file mode 100644
index 0000000..3d07128
--- /dev/null
+++ b/src/app/modules/deviceGroup/controller/app/deviceGroup.ts
@@ -0,0 +1,15 @@
+import { Provide } from '@midwayjs/decorator';
+import { CoolController, BaseController } from '@cool-midway/core';
+import { DemodeviceGroupEntity } from '../../entity/deviceGroup';
+
+/**
+ * test
+ */
+@Provide()
+@CoolController(
+ {
+ api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+ entity: DemodeviceGroupEntity
+ }
+)
+export class DemoAppdGController extends BaseController { }
diff --git a/src/app/modules/deviceGroup/entity/deviceGroup.ts b/src/app/modules/deviceGroup/entity/deviceGroup.ts
new file mode 100644
index 0000000..9d50b8e
--- /dev/null
+++ b/src/app/modules/deviceGroup/entity/deviceGroup.ts
@@ -0,0 +1,24 @@
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from '@cool-midway/core';
+import { Column, PrimaryGeneratedColumn } from 'typeorm';
+
+/**
+ * 鍟嗗搧
+ */
+@EntityModel('devicegroup_fcs')
+export class DemodeviceGroupEntity extends BaseEntity {
+ @PrimaryGeneratedColumn({ comment: 'id' })
+ id: number;
+
+ @Column({ comment: '閫昏緫ID' })
+ logic_id: string;
+
+ @Column({ comment: '鍒嗙粍璁剧疆浜哄憳' })
+ configurator: string;
+
+ @Column({ comment: '澶囨敞', default: "鏃�" })
+ remark: string;
+
+ @Column({ comment: '鐘舵��', default: 1 })
+ status: boolean;
+}
diff --git a/src/app/modules/taskSetting/config.ts b/src/app/modules/taskSetting/config.ts
new file mode 100644
index 0000000..3dd463f
--- /dev/null
+++ b/src/app/modules/taskSetting/config.ts
@@ -0,0 +1,16 @@
+import { Application } from 'egg';
+import { ModuleConfig } from '@cool-midway/core';
+
+/**
+ * 妯″潡閰嶇疆
+ */
+export default (app: Application) => {
+ return {
+ // 妯″潡鍚嶇О
+ name: 'taskSetting',
+ // 妯″潡鎻忚堪
+ description: '鍒嗙粍浠诲姟鍙傛暟璁剧疆琛�',
+ // 涓棿浠讹紝鍙鏈ā鍧楁湁鏁�
+ middlewares: [],
+ } as ModuleConfig;
+};
\ No newline at end of file
diff --git a/src/app/modules/taskSetting/controller/admin/taskSetting.ts b/src/app/modules/taskSetting/controller/admin/taskSetting.ts
new file mode 100644
index 0000000..6f9b42c
--- /dev/null
+++ b/src/app/modules/taskSetting/controller/admin/taskSetting.ts
@@ -0,0 +1,13 @@
+import { Provide } from '@midwayjs/decorator';
+import { CoolController, BaseController } from '@cool-midway/core';
+import { DemotaskSettingEntity } from '../../entity/taskSetting';
+
+/**
+ * 鎻忚堪
+ */
+@Provide()
+@CoolController({
+ api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+ entity: DemotaskSettingEntity,
+})
+export class DemoAdmintaskSettingController extends BaseController { }
diff --git a/src/app/modules/taskSetting/controller/app/taskSetting.ts b/src/app/modules/taskSetting/controller/app/taskSetting.ts
new file mode 100644
index 0000000..fb46c23
--- /dev/null
+++ b/src/app/modules/taskSetting/controller/app/taskSetting.ts
@@ -0,0 +1,15 @@
+import { Provide } from '@midwayjs/decorator';
+import { CoolController, BaseController } from '@cool-midway/core';
+import { DemotaskSettingEntity } from '../../entity/taskSetting';
+
+/**
+ * test
+ */
+@Provide()
+@CoolController(
+ {
+ api: ['add', 'delete', 'update', 'info', 'list', 'page'],
+ entity: DemotaskSettingEntity
+ }
+)
+export class DemoApptSController extends BaseController { }
diff --git a/src/app/modules/taskSetting/entity/taskSetting.ts b/src/app/modules/taskSetting/entity/taskSetting.ts
new file mode 100644
index 0000000..9928abe
--- /dev/null
+++ b/src/app/modules/taskSetting/entity/taskSetting.ts
@@ -0,0 +1,42 @@
+import { EntityModel } from '@midwayjs/orm';
+import { BaseEntity } from '@cool-midway/core';
+import { Column, PrimaryGeneratedColumn } from 'typeorm';
+
+/**
+ * 鍟嗗搧
+ */
+@EntityModel('tasksetting_fcs')
+export class DemotaskSettingEntity extends BaseEntity {
+ @PrimaryGeneratedColumn({ comment: 'id' })
+ id: number;
+
+ @Column({ comment: '璁惧鍒嗙粍ID' })
+ group_id: string;
+
+ @Column({ comment: '鍛ㄦ湡浠诲姟' })
+ crontab_rule: string;
+
+ @Column({ comment: '浠诲姟绫诲瀷', default: "鏃�" })
+ task_type: string;
+
+ @Column({ comment: '浠诲姟鍐呭鎻忚堪', default: "鏃�" })
+ task_content: string;
+
+ @Column({ comment: '浠诲姟鍛戒护鏍煎紡', default: "鏃�" })
+ task_command: string;
+
+ @Column({ comment: '浠诲姟鍙傛暟', default: "鏃�" })
+ task_params: string;
+
+ @Column({ comment: '璁剧疆浜�' })
+ operator: string;
+
+ @Column({ comment: '浠诲姟缁撴潫鏃堕棿', default: "鏃�" })
+ end_time: string;
+
+ @Column({ comment: '澶囨敞', default: "鏃�" })
+ remark: string;
+
+ @Column({ comment: '鐘舵��', default: true })
+ status: boolean;
+}
--
Gitblit v1.9.1