| New file |
| | |
| | | import { Application } from 'egg'; |
| | | import { ModuleConfig } from '@cool-midway/core'; |
| | | |
| | | /** |
| | | * 模块配置 |
| | | */ |
| | | export default (app: Application) => { |
| | | return { |
| | | // 模块名称 |
| | | name: 'device', |
| | | // 模块描述 |
| | | description: '采集设备', |
| | | // 中间件,只对本模块有效 |
| | | middlewares: [], |
| | | } as ModuleConfig; |
| | | }; |
| New file |
| | |
| | | import { Provide } from '@midwayjs/decorator'; |
| | | import { CoolController, BaseController } from '@cool-midway/core'; |
| | | import { DemoDeviceEntity } from '../../entity/device'; |
| | | |
| | | /** |
| | | * 描述 |
| | | */ |
| | | @Provide() |
| | | @CoolController({ |
| | | api: ['add', 'delete', 'update', 'info', 'list', 'page'], |
| | | entity: DemoDeviceEntity, |
| | | }) |
| | | export class DemoAdminDeviceController extends BaseController { } |
| New file |
| | |
| | | import { Provide } from '@midwayjs/decorator'; |
| | | import { CoolController, BaseController } from '@cool-midway/core'; |
| | | import { DemoDeviceEntity } from '../../entity/device'; |
| | | |
| | | /** |
| | | * test |
| | | */ |
| | | @Provide() |
| | | @CoolController( |
| | | { |
| | | api: ['add', 'delete', 'update', 'info', 'list', 'page'], |
| | | entity: DemoDeviceEntity |
| | | } |
| | | ) |
| | | export class DemoAppDeviceController extends BaseController { } |
| New file |
| | |
| | | import { EntityModel } from '@midwayjs/orm'; |
| | | import { BaseEntity } from '@cool-midway/core'; |
| | | import { Column, PrimaryGeneratedColumn } from 'typeorm'; |
| | | |
| | | /** |
| | | * 商品 |
| | | */ |
| | | @EntityModel('device') |
| | | export class DemoDeviceEntity extends BaseEntity { |
| | | @PrimaryGeneratedColumn({ comment: 'id' }) |
| | | id: number; |
| | | |
| | | @Column({ comment: '逻辑ID' }) |
| | | logic_id: string; |
| | | |
| | | @Column({ comment: '物理ID' }) |
| | | device_id: string; |
| | | |
| | | @Column({ comment: '设备名称', default: "可见光-毫米波-采集设备" }) |
| | | name: string; |
| | | |
| | | @Column({ comment: '安装位置', default: "华能电厂二号煤棚-第一马道-北" }) |
| | | location: string; |
| | | |
| | | @Column({ comment: '经度', type: 'double', default: 121.222222222 }) |
| | | longitude: number; |
| | | |
| | | @Column({ comment: '纬度', type: 'double', default: 31.222222222 }) |
| | | latitude: number; |
| | | |
| | | @Column({ comment: '高度', type: 'double', default: 40 }) |
| | | altitude: number; |
| | | |
| | | @Column({ comment: '设备尺寸', default: "110*110" }) |
| | | dimension: string; |
| | | |
| | | @Column({ comment: '设备精度', default: "3" }) |
| | | precision: string; |
| | | |
| | | @Column({ comment: '航向角', default: "90" }) |
| | | heading_angle: string; |
| | | |
| | | @Column({ comment: '俯仰角', default: "90" }) |
| | | petch_angle: string; |
| | | |
| | | @Column({ comment: '横滚角', default: "90" }) |
| | | roll_angle: string; |
| | | |
| | | @Column({ comment: 'IP地址', default: "127.0.0.1" }) |
| | | ipaddress: string; |
| | | |
| | | @Column({ comment: '端口', default: "8001" }) |
| | | device_port: string; |
| | | |
| | | @Column({ comment: '账号', default: "admin" }) |
| | | device_account: string; |
| | | |
| | | @Column({ comment: '密码', default: "123456" }) |
| | | device_psw: string; |
| | | |
| | | @Column({ comment: '运维负责人' }) |
| | | operator: string; |
| | | |
| | | @Column({ comment: '备注', default: "无" }) |
| | | remark: string; |
| | | |
| | | @Column({ comment: '状态', default: 1 }) |
| | | status: number; |
| | | } |
| | |
| | | import { DemoHuanengEntity } from '../../entity/huaneng'; |
| | | |
| | | /** |
| | | * 商品 |
| | | * test |
| | | */ |
| | | @Provide() |
| | | @CoolController( |