Compare commits

..

1 Commits

Author SHA1 Message Date
iioter
3dd26fd973 mysql init 2022-11-07 12:52:13 +08:00
534 changed files with 68071 additions and 79404 deletions

4
.gitignore vendored
View File

@ -17,6 +17,4 @@ bin-release/
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
/.vs
/IoTGateway/wwwroot/3d
/IoTGateway/iotgateway.db-wal
/IoTGateway/iotgateway.db-shm
/IoTGateway/wwwroot/3d

View File

@ -1,282 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>3D</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="./css/main.css">
<style>
body {
background-color: #bfe3dd;
color: #000;
}
a {
color: #2983ff;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="../jquery.min.js"></script>
<script src="../mqtt.min.js"></script>
<script type="module">
import * as THREE from './lib/three.module.js';
import Stats from './lib/stats.module.js';
import { OrbitControls } from './lib/OrbitControls.js';
import { RoomEnvironment } from './lib/RoomEnvironment.js';
import { GLTFLoader } from './lib/GLTFLoader.js';
import { DRACOLoader } from './lib/DRACOLoader.js';
import { CSS3DObject, CSS3DRenderer } from './lib/CSS3DRenderer.js';
let W = window.innerWidth;
let H = window.innerHeight;
let mixer;
let labelArr = [];
//标签数据
let modelData = [{
id: 1,
cname: "Modbus设备",
ename: "modbus_01",
position: {
x: -0.5,
y: 0.6,
z: 1.55,
},
param: [{
name: "温度",
value: 123,
},
{
name: "湿度",
value: 123,
},
],
}
];
//定时更新数据
//setInterval(() => {
// modelData.forEach((item) => {
// if (item.id > 0) {
// item.param[0].value = parseInt(Math.random() * 30 + 150).toFixed(0);
// item.param[1].value = parseInt(Math.random() * 30 + 150).toFixed(0);
// }
// });
// updateData();
//}, 2000);
inimqttclient();
const clock = new THREE.Clock();
const container = document.getElementById('container');
const stats = new Stats();
container.appendChild(stats.dom);
const css3dRenderer = new CSS3DRenderer();
css3dRenderer.setSize(W, H);
css3dRenderer.domElement.style.position = 'absolute';
css3dRenderer.domElement.style.top = 0;
container.appendChild(css3dRenderer.domElement);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputEncoding = THREE.sRGBEncoding;
container.appendChild(renderer.domElement);
const pmremGenerator = new THREE.PMREMGenerator(renderer);
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xbfe3dd);
scene.environment = pmremGenerator.fromScene(new RoomEnvironment(), 0.04).texture;
const camera = new THREE.PerspectiveCamera(40, W / H, .1, 10000);
camera.position.set(5, 2, 8);
const controls = new OrbitControls(camera, container);
controls.target.set(0, 0.5, 0);
controls.update();
controls.enablePan = false;
controls.enableDamping = true;
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('./lib/gltf/');
const loader = new GLTFLoader();
loader.setDRACOLoader(dracoLoader);
loader.load('./model/LittlestTokyo.glb', function (gltf) {
const model = gltf.scene;
model.position.set(1, 1, 0);
model.scale.set(0.01, 0.01, 0.01);
scene.add(model);
createLableArr();
mixer = new THREE.AnimationMixer(model);
mixer.clipAction(gltf.animations[0]).play();
animate();
}, undefined, function (e) {
console.error(e);
});
//创建标签
function createLableArr() {
let style = "color: #00CED1;cursor:pointer;font-size:30px;padding:5px 15px;"; //background:#43bafe;
modelData.forEach((item) => {
let label = createLabel(item.cname, style, item.param);
label.position.set(item.position.x, item.position.y, item.position.z);
let scale = 0.003;
label.scale.set(scale, scale, scale); //缩放比例
label.name = item.ename;
//label.visible = true;
scene.add(label);
labelArr.push(label);
const axesHelper = new THREE.AxesHelper(5);
label.add(axesHelper);
});
}
/**销毁模型*/
function destroyObject(object) {
if (!object) return;
object.traverse((item) => {
if (item.material) {
if (Array.isArray(item.material)) {
item.material.forEach(m => m.dispose());
} else {
item.material.dispose();
}
}
if (item.geometry) item.geometry.dispose();
item = null;
});
scene.remove(object);
object = null;
}
/**信息标注的生成*/
function createLabel(text, style, param) {
//创建CSS3D
let div_label = document.createElement("div");
div_label.className = "div-label";
let div_ul = document.createElement("ul");
let div_li = document.createElement("li");
style ? (div_li.style = style) : "";
div_li.textContent = `设备名称:${text}`;
div_ul.appendChild(div_li);
if (param.length) {
param.forEach((item) => {
let param_li = document.createElement("li");
style ? (param_li.style = style) : "";
param_li.textContent = `${item.name}:${item.value}`;
div_ul.appendChild(param_li);
});
}
div_label.appendChild(div_ul);
let label = new CSS3DObject(div_label);
return label;
}
//更新数据标签
function updateData() {
if (labelArr.length) {
labelArr.forEach(item => {
destroyObject(item);
});
createLableArr();
}
}
window.onresize = function () {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
};
function animate() {
requestAnimationFrame(animate);
const delta = clock.getDelta();
mixer.update(delta);
controls.update();
//标签
// if (labelArr.length) {
// labelArr.forEach((item) => {
// if (item.visible) {
// item.quaternion.slerp(camera.quaternion, 1);
// }
// });
// }
stats.update();
renderer.render(scene, camera);
css3dRenderer.render(scene, camera);
}
function inimqttclient() {
var options = {
//mqtt客户端的id这里面应该还可以加上其他参数具体看官方文档
clientId: 'mqttjs3d_' + (Math.random() * 10000000).toString()
}
var client = mqtt.connect('ws://' + window.location.host + '/mqtt', options);
client.on('connect', function () {
client.subscribe('internal/v1/gateway/telemetry/+/+', function (err) {
if (!err) {
console.log("订阅成功!")
} else {
console.log(err)
}
})
})
client.on('message', function (topic, message) {
if (topic == 'internal/v1/gateway/telemetry/Modbus/temperature') {
var objmsg = $.parseJSON(message.toString());
modelData[0].param[0].value = objmsg.CookedValue;
updateData();
} else if (topic == 'internal/v1/gateway/telemetry/Modbus/humidity') {
var objmsg = $.parseJSON(message.toString());
modelData[0].param[1].value = objmsg.CookedValue;
updateData();
}
})
}
</script>
</body>
</html>

View File

@ -1,108 +0,0 @@
body {
margin: 0;
background-color: #000;
color: #fff;
font-family: Monospace;
font-size: 13px;
line-height: 24px;
overscroll-behavior: none;
}
a {
color: #ff0;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
button {
cursor: pointer;
text-transform: uppercase;
}
#info {
position: absolute;
top: 0px;
width: 100%;
padding: 10px;
box-sizing: border-box;
text-align: center;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
z-index: 1; /* TODO Solve this in HTML */
}
a, button, input, select {
pointer-events: auto;
}
.lil-gui {
z-index: 2 !important; /* TODO Solve this in HTML */
}
@media all and ( max-width: 640px ) {
.lil-gui.root {
right: auto;
top: auto;
max-height: 50%;
max-width: 80%;
bottom: 0;
left: 0;
}
}
#overlay {
position: absolute;
font-size: 16px;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: rgba(0,0,0,0.7);
}
#overlay button {
background: transparent;
border: 0;
border: 1px solid rgb(255, 255, 255);
border-radius: 4px;
color: #ffffff;
padding: 12px 18px;
text-transform: uppercase;
cursor: pointer;
}
#notSupported {
width: 50%;
margin: auto;
background-color: #f00;
margin-top: 20px;
padding: 10px;
}
.div-label {
width: 355px;
height: 255px;
background: url("../image/info.png") no-repeat;
}
.div-label ul {
margin: 80px 40px;
width: 355px;
height: 255px;
}
.div-label li {
margin: 20px 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,308 +0,0 @@
import {
Matrix4,
Object3D,
Quaternion,
Vector3
} from './three.module.js';
/**
* Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
*/
const _position = new Vector3();
const _quaternion = new Quaternion();
const _scale = new Vector3();
class CSS3DObject extends Object3D {
constructor( element = document.createElement( 'div' ) ) {
super();
this.element = element;
this.element.style.position = 'absolute';
this.element.style.pointerEvents = 'auto';
this.element.style.userSelect = 'none';
this.element.setAttribute( 'draggable', false );
this.addEventListener( 'removed', function () {
this.traverse( function ( object ) {
if ( object.element instanceof Element && object.element.parentNode !== null ) {
object.element.parentNode.removeChild( object.element );
}
} );
} );
}
copy( source, recursive ) {
super.copy( source, recursive );
this.element = source.element.cloneNode( true );
return this;
}
}
CSS3DObject.prototype.isCSS3DObject = true;
class CSS3DSprite extends CSS3DObject {
constructor( element ) {
super( element );
this.rotation2D = 0;
}
copy( source, recursive ) {
super.copy( source, recursive );
this.rotation2D = source.rotation2D;
return this;
}
}
CSS3DSprite.prototype.isCSS3DSprite = true;
//
const _matrix = new Matrix4();
const _matrix2 = new Matrix4();
class CSS3DRenderer {
constructor( parameters = {} ) {
const _this = this;
let _width, _height;
let _widthHalf, _heightHalf;
const cache = {
camera: { fov: 0, style: '' },
objects: new WeakMap()
};
const domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );
domElement.style.overflow = 'hidden';
this.domElement = domElement;
const cameraElement = document.createElement( 'div' );
cameraElement.style.transformStyle = 'preserve-3d';
cameraElement.style.pointerEvents = 'none';
domElement.appendChild( cameraElement );
this.getSize = function () {
return {
width: _width,
height: _height
};
};
this.render = function ( scene, camera ) {
const fov = camera.projectionMatrix.elements[ 5 ] * _heightHalf;
if ( cache.camera.fov !== fov ) {
domElement.style.perspective = camera.isPerspectiveCamera ? fov + 'px' : '';
cache.camera.fov = fov;
}
if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
if ( camera.parent === null ) camera.updateMatrixWorld();
let tx, ty;
if ( camera.isOrthographicCamera ) {
tx = - ( camera.right + camera.left ) / 2;
ty = ( camera.top + camera.bottom ) / 2;
}
const cameraCSSMatrix = camera.isOrthographicCamera ?
'scale(' + fov + ')' + 'translate(' + epsilon( tx ) + 'px,' + epsilon( ty ) + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse ) :
'translateZ(' + fov + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse );
const style = cameraCSSMatrix +
'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)';
if ( cache.camera.style !== style ) {
cameraElement.style.transform = style;
cache.camera.style = style;
}
renderObject( scene, scene, camera, cameraCSSMatrix );
};
this.setSize = function ( width, height ) {
_width = width;
_height = height;
_widthHalf = _width / 2;
_heightHalf = _height / 2;
domElement.style.width = width + 'px';
domElement.style.height = height + 'px';
cameraElement.style.width = width + 'px';
cameraElement.style.height = height + 'px';
};
function epsilon( value ) {
return Math.abs( value ) < 1e-10 ? 0 : value;
}
function getCameraCSSMatrix( matrix ) {
const elements = matrix.elements;
return 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( - elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' +
epsilon( elements[ 6 ] ) + ',' +
epsilon( elements[ 7 ] ) + ',' +
epsilon( elements[ 8 ] ) + ',' +
epsilon( - elements[ 9 ] ) + ',' +
epsilon( elements[ 10 ] ) + ',' +
epsilon( elements[ 11 ] ) + ',' +
epsilon( elements[ 12 ] ) + ',' +
epsilon( - elements[ 13 ] ) + ',' +
epsilon( elements[ 14 ] ) + ',' +
epsilon( elements[ 15 ] ) +
')';
}
function getObjectCSSMatrix( matrix ) {
const elements = matrix.elements;
const matrix3d = 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( - elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' +
epsilon( - elements[ 6 ] ) + ',' +
epsilon( - elements[ 7 ] ) + ',' +
epsilon( elements[ 8 ] ) + ',' +
epsilon( elements[ 9 ] ) + ',' +
epsilon( elements[ 10 ] ) + ',' +
epsilon( elements[ 11 ] ) + ',' +
epsilon( elements[ 12 ] ) + ',' +
epsilon( elements[ 13 ] ) + ',' +
epsilon( elements[ 14 ] ) + ',' +
epsilon( elements[ 15 ] ) +
')';
return 'translate(-50%,-50%)' + matrix3d;
}
function renderObject( object, scene, camera, cameraCSSMatrix ) {
if ( object.isCSS3DObject ) {
object.onBeforeRender( _this, scene, camera );
let style;
if ( object.isCSS3DSprite ) {
// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
_matrix.copy( camera.matrixWorldInverse );
_matrix.transpose();
if ( object.rotation2D !== 0 ) _matrix.multiply( _matrix2.makeRotationZ( object.rotation2D ) );
object.matrixWorld.decompose( _position, _quaternion, _scale );
_matrix.setPosition( _position );
_matrix.scale( _scale );
_matrix.elements[ 3 ] = 0;
_matrix.elements[ 7 ] = 0;
_matrix.elements[ 11 ] = 0;
_matrix.elements[ 15 ] = 1;
style = getObjectCSSMatrix( _matrix );
} else {
style = getObjectCSSMatrix( object.matrixWorld );
}
const element = object.element;
const cachedObject = cache.objects.get( object );
if ( cachedObject === undefined || cachedObject.style !== style ) {
element.style.transform = style;
const objectData = { style: style };
cache.objects.set( object, objectData );
}
element.style.display = object.visible ? '' : 'none';
if ( element.parentNode !== cameraElement ) {
cameraElement.appendChild( element );
}
object.onAfterRender( _this, scene, camera );
}
for ( let i = 0, l = object.children.length; i < l; i ++ ) {
renderObject( object.children[ i ], scene, camera, cameraCSSMatrix );
}
}
}
}
export { CSS3DObject, CSS3DSprite, CSS3DRenderer };

View File

@ -1,587 +0,0 @@
import {
BufferAttribute,
BufferGeometry,
FileLoader,
Loader
} from './three.module.js';
const _taskCache = new WeakMap();
class DRACOLoader extends Loader {
constructor( manager ) {
super( manager );
this.decoderPath = '';
this.decoderConfig = {};
this.decoderBinary = null;
this.decoderPending = null;
this.workerLimit = 4;
this.workerPool = [];
this.workerNextTaskID = 1;
this.workerSourceURL = '';
this.defaultAttributeIDs = {
position: 'POSITION',
normal: 'NORMAL',
color: 'COLOR',
uv: 'TEX_COORD'
};
this.defaultAttributeTypes = {
position: 'Float32Array',
normal: 'Float32Array',
color: 'Float32Array',
uv: 'Float32Array'
};
}
setDecoderPath( path ) {
this.decoderPath = path;
return this;
}
setDecoderConfig( config ) {
this.decoderConfig = config;
return this;
}
setWorkerLimit( workerLimit ) {
this.workerLimit = workerLimit;
return this;
}
load( url, onLoad, onProgress, onError ) {
const loader = new FileLoader( this.manager );
loader.setPath( this.path );
loader.setResponseType( 'arraybuffer' );
loader.setRequestHeader( this.requestHeader );
loader.setWithCredentials( this.withCredentials );
loader.load( url, ( buffer ) => {
const taskConfig = {
attributeIDs: this.defaultAttributeIDs,
attributeTypes: this.defaultAttributeTypes,
useUniqueIDs: false
};
this.decodeGeometry( buffer, taskConfig )
.then( onLoad )
.catch( onError );
}, onProgress, onError );
}
/** @deprecated Kept for backward-compatibility with previous DRACOLoader versions. */
decodeDracoFile( buffer, callback, attributeIDs, attributeTypes ) {
const taskConfig = {
attributeIDs: attributeIDs || this.defaultAttributeIDs,
attributeTypes: attributeTypes || this.defaultAttributeTypes,
useUniqueIDs: !! attributeIDs
};
this.decodeGeometry( buffer, taskConfig ).then( callback );
}
decodeGeometry( buffer, taskConfig ) {
// TODO: For backward-compatibility, support 'attributeTypes' objects containing
// references (rather than names) to typed array constructors. These must be
// serialized before sending them to the worker.
for ( const attribute in taskConfig.attributeTypes ) {
const type = taskConfig.attributeTypes[ attribute ];
if ( type.BYTES_PER_ELEMENT !== undefined ) {
taskConfig.attributeTypes[ attribute ] = type.name;
}
}
//
const taskKey = JSON.stringify( taskConfig );
// Check for an existing task using this buffer. A transferred buffer cannot be transferred
// again from this thread.
if ( _taskCache.has( buffer ) ) {
const cachedTask = _taskCache.get( buffer );
if ( cachedTask.key === taskKey ) {
return cachedTask.promise;
} else if ( buffer.byteLength === 0 ) {
// Technically, it would be possible to wait for the previous task to complete,
// transfer the buffer back, and decode again with the second configuration. That
// is complex, and I don't know of any reason to decode a Draco buffer twice in
// different ways, so this is left unimplemented.
throw new Error(
'THREE.DRACOLoader: Unable to re-decode a buffer with different ' +
'settings. Buffer has already been transferred.'
);
}
}
//
let worker;
const taskID = this.workerNextTaskID ++;
const taskCost = buffer.byteLength;
// Obtain a worker and assign a task, and construct a geometry instance
// when the task completes.
const geometryPending = this._getWorker( taskID, taskCost )
.then( ( _worker ) => {
worker = _worker;
return new Promise( ( resolve, reject ) => {
worker._callbacks[ taskID ] = { resolve, reject };
worker.postMessage( { type: 'decode', id: taskID, taskConfig, buffer }, [ buffer ] );
// this.debug();
} );
} )
.then( ( message ) => this._createGeometry( message.geometry ) );
// Remove task from the task list.
// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)
geometryPending
.catch( () => true )
.then( () => {
if ( worker && taskID ) {
this._releaseTask( worker, taskID );
// this.debug();
}
} );
// Cache the task result.
_taskCache.set( buffer, {
key: taskKey,
promise: geometryPending
} );
return geometryPending;
}
_createGeometry( geometryData ) {
const geometry = new BufferGeometry();
if ( geometryData.index ) {
geometry.setIndex( new BufferAttribute( geometryData.index.array, 1 ) );
}
for ( let i = 0; i < geometryData.attributes.length; i ++ ) {
const attribute = geometryData.attributes[ i ];
const name = attribute.name;
const array = attribute.array;
const itemSize = attribute.itemSize;
geometry.setAttribute( name, new BufferAttribute( array, itemSize ) );
}
return geometry;
}
_loadLibrary( url, responseType ) {
const loader = new FileLoader( this.manager );
loader.setPath( this.decoderPath );
loader.setResponseType( responseType );
loader.setWithCredentials( this.withCredentials );
return new Promise( ( resolve, reject ) => {
loader.load( url, resolve, undefined, reject );
} );
}
preload() {
this._initDecoder();
return this;
}
_initDecoder() {
if ( this.decoderPending ) return this.decoderPending;
const useJS = typeof WebAssembly !== 'object' || this.decoderConfig.type === 'js';
const librariesPending = [];
if ( useJS ) {
librariesPending.push( this._loadLibrary( 'draco_decoder.js', 'text' ) );
} else {
librariesPending.push( this._loadLibrary( 'draco_wasm_wrapper.js', 'text' ) );
librariesPending.push( this._loadLibrary( 'draco_decoder.wasm', 'arraybuffer' ) );
}
this.decoderPending = Promise.all( librariesPending )
.then( ( libraries ) => {
const jsContent = libraries[ 0 ];
if ( ! useJS ) {
this.decoderConfig.wasmBinary = libraries[ 1 ];
}
const fn = DRACOWorker.toString();
const body = [
'/* draco decoder */',
jsContent,
'',
'/* worker */',
fn.substring( fn.indexOf( '{' ) + 1, fn.lastIndexOf( '}' ) )
].join( '\n' );
this.workerSourceURL = URL.createObjectURL( new Blob( [ body ] ) );
} );
return this.decoderPending;
}
_getWorker( taskID, taskCost ) {
return this._initDecoder().then( () => {
if ( this.workerPool.length < this.workerLimit ) {
const worker = new Worker( this.workerSourceURL );
worker._callbacks = {};
worker._taskCosts = {};
worker._taskLoad = 0;
worker.postMessage( { type: 'init', decoderConfig: this.decoderConfig } );
worker.onmessage = function ( e ) {
const message = e.data;
switch ( message.type ) {
case 'decode':
worker._callbacks[ message.id ].resolve( message );
break;
case 'error':
worker._callbacks[ message.id ].reject( message );
break;
default:
console.error( 'THREE.DRACOLoader: Unexpected message, "' + message.type + '"' );
}
};
this.workerPool.push( worker );
} else {
this.workerPool.sort( function ( a, b ) {
return a._taskLoad > b._taskLoad ? - 1 : 1;
} );
}
const worker = this.workerPool[ this.workerPool.length - 1 ];
worker._taskCosts[ taskID ] = taskCost;
worker._taskLoad += taskCost;
return worker;
} );
}
_releaseTask( worker, taskID ) {
worker._taskLoad -= worker._taskCosts[ taskID ];
delete worker._callbacks[ taskID ];
delete worker._taskCosts[ taskID ];
}
debug() {
console.log( 'Task load: ', this.workerPool.map( ( worker ) => worker._taskLoad ) );
}
dispose() {
for ( let i = 0; i < this.workerPool.length; ++ i ) {
this.workerPool[ i ].terminate();
}
this.workerPool.length = 0;
return this;
}
}
/* WEB WORKER */
function DRACOWorker() {
let decoderConfig;
let decoderPending;
onmessage = function ( e ) {
const message = e.data;
switch ( message.type ) {
case 'init':
decoderConfig = message.decoderConfig;
decoderPending = new Promise( function ( resolve/*, reject*/ ) {
decoderConfig.onModuleLoaded = function ( draco ) {
// Module is Promise-like. Wrap before resolving to avoid loop.
resolve( { draco: draco } );
};
DracoDecoderModule( decoderConfig ); // eslint-disable-line no-undef
} );
break;
case 'decode':
const buffer = message.buffer;
const taskConfig = message.taskConfig;
decoderPending.then( ( module ) => {
const draco = module.draco;
const decoder = new draco.Decoder();
const decoderBuffer = new draco.DecoderBuffer();
decoderBuffer.Init( new Int8Array( buffer ), buffer.byteLength );
try {
const geometry = decodeGeometry( draco, decoder, decoderBuffer, taskConfig );
const buffers = geometry.attributes.map( ( attr ) => attr.array.buffer );
if ( geometry.index ) buffers.push( geometry.index.array.buffer );
self.postMessage( { type: 'decode', id: message.id, geometry }, buffers );
} catch ( error ) {
console.error( error );
self.postMessage( { type: 'error', id: message.id, error: error.message } );
} finally {
draco.destroy( decoderBuffer );
draco.destroy( decoder );
}
} );
break;
}
};
function decodeGeometry( draco, decoder, decoderBuffer, taskConfig ) {
const attributeIDs = taskConfig.attributeIDs;
const attributeTypes = taskConfig.attributeTypes;
let dracoGeometry;
let decodingStatus;
const geometryType = decoder.GetEncodedGeometryType( decoderBuffer );
if ( geometryType === draco.TRIANGULAR_MESH ) {
dracoGeometry = new draco.Mesh();
decodingStatus = decoder.DecodeBufferToMesh( decoderBuffer, dracoGeometry );
} else if ( geometryType === draco.POINT_CLOUD ) {
dracoGeometry = new draco.PointCloud();
decodingStatus = decoder.DecodeBufferToPointCloud( decoderBuffer, dracoGeometry );
} else {
throw new Error( 'THREE.DRACOLoader: Unexpected geometry type.' );
}
if ( ! decodingStatus.ok() || dracoGeometry.ptr === 0 ) {
throw new Error( 'THREE.DRACOLoader: Decoding failed: ' + decodingStatus.error_msg() );
}
const geometry = { index: null, attributes: [] };
// Gather all vertex attributes.
for ( const attributeName in attributeIDs ) {
const attributeType = self[ attributeTypes[ attributeName ] ];
let attribute;
let attributeID;
// A Draco file may be created with default vertex attributes, whose attribute IDs
// are mapped 1:1 from their semantic name (POSITION, NORMAL, ...). Alternatively,
// a Draco file may contain a custom set of attributes, identified by known unique
// IDs. glTF files always do the latter, and `.drc` files typically do the former.
if ( taskConfig.useUniqueIDs ) {
attributeID = attributeIDs[ attributeName ];
attribute = decoder.GetAttributeByUniqueId( dracoGeometry, attributeID );
} else {
attributeID = decoder.GetAttributeId( dracoGeometry, draco[ attributeIDs[ attributeName ] ] );
if ( attributeID === - 1 ) continue;
attribute = decoder.GetAttribute( dracoGeometry, attributeID );
}
geometry.attributes.push( decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) );
}
// Add index.
if ( geometryType === draco.TRIANGULAR_MESH ) {
geometry.index = decodeIndex( draco, decoder, dracoGeometry );
}
draco.destroy( dracoGeometry );
return geometry;
}
function decodeIndex( draco, decoder, dracoGeometry ) {
const numFaces = dracoGeometry.num_faces();
const numIndices = numFaces * 3;
const byteLength = numIndices * 4;
const ptr = draco._malloc( byteLength );
decoder.GetTrianglesUInt32Array( dracoGeometry, byteLength, ptr );
const index = new Uint32Array( draco.HEAPF32.buffer, ptr, numIndices ).slice();
draco._free( ptr );
return { array: index, itemSize: 1 };
}
function decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) {
const numComponents = attribute.num_components();
const numPoints = dracoGeometry.num_points();
const numValues = numPoints * numComponents;
const byteLength = numValues * attributeType.BYTES_PER_ELEMENT;
const dataType = getDracoDataType( draco, attributeType );
const ptr = draco._malloc( byteLength );
decoder.GetAttributeDataArrayForAllPoints( dracoGeometry, attribute, dataType, byteLength, ptr );
const array = new attributeType( draco.HEAPF32.buffer, ptr, numValues ).slice();
draco._free( ptr );
return {
name: attributeName,
array: array,
itemSize: numComponents
};
}
function getDracoDataType( draco, attributeType ) {
switch ( attributeType ) {
case Float32Array: return draco.DT_FLOAT32;
case Int8Array: return draco.DT_INT8;
case Int16Array: return draco.DT_INT16;
case Int32Array: return draco.DT_INT32;
case Uint8Array: return draco.DT_UINT8;
case Uint16Array: return draco.DT_UINT16;
case Uint32Array: return draco.DT_UINT32;
}
}
}
export { DRACOLoader };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,121 +0,0 @@
/**
* https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
*/
import {
BackSide,
BoxGeometry,
Mesh,
MeshBasicMaterial,
MeshStandardMaterial,
PointLight,
Scene,
} from './three.module.js';
class RoomEnvironment extends Scene {
constructor() {
super();
const geometry = new BoxGeometry();
geometry.deleteAttribute( 'uv' );
const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
const boxMaterial = new MeshStandardMaterial();
const mainLight = new PointLight( 0xffffff, 5.0, 28, 2 );
mainLight.position.set( 0.418, 16.199, 0.300 );
this.add( mainLight );
const room = new Mesh( geometry, roomMaterial );
room.position.set( - 0.757, 13.219, 0.717 );
room.scale.set( 31.713, 28.305, 28.591 );
this.add( room );
const box1 = new Mesh( geometry, boxMaterial );
box1.position.set( - 10.906, 2.009, 1.846 );
box1.rotation.set( 0, - 0.195, 0 );
box1.scale.set( 2.328, 7.905, 4.651 );
this.add( box1 );
const box2 = new Mesh( geometry, boxMaterial );
box2.position.set( - 5.607, - 0.754, - 0.758 );
box2.rotation.set( 0, 0.994, 0 );
box2.scale.set( 1.970, 1.534, 3.955 );
this.add( box2 );
const box3 = new Mesh( geometry, boxMaterial );
box3.position.set( 6.167, 0.857, 7.803 );
box3.rotation.set( 0, 0.561, 0 );
box3.scale.set( 3.927, 6.285, 3.687 );
this.add( box3 );
const box4 = new Mesh( geometry, boxMaterial );
box4.position.set( - 2.017, 0.018, 6.124 );
box4.rotation.set( 0, 0.333, 0 );
box4.scale.set( 2.002, 4.566, 2.064 );
this.add( box4 );
const box5 = new Mesh( geometry, boxMaterial );
box5.position.set( 2.291, - 0.756, - 2.621 );
box5.rotation.set( 0, - 0.286, 0 );
box5.scale.set( 1.546, 1.552, 1.496 );
this.add( box5 );
const box6 = new Mesh( geometry, boxMaterial );
box6.position.set( - 2.193, - 0.369, - 5.547 );
box6.rotation.set( 0, 0.516, 0 );
box6.scale.set( 3.875, 3.487, 2.986 );
this.add( box6 );
// -x right
const light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
light1.position.set( - 16.116, 14.37, 8.208 );
light1.scale.set( 0.1, 2.428, 2.739 );
this.add( light1 );
// -x left
const light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
light2.position.set( - 16.109, 18.021, - 8.207 );
light2.scale.set( 0.1, 2.425, 2.751 );
this.add( light2 );
// +x
const light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );
light3.position.set( 14.904, 12.198, - 1.832 );
light3.scale.set( 0.15, 4.265, 6.331 );
this.add( light3 );
// +z
const light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );
light4.position.set( - 0.462, 8.89, 14.520 );
light4.scale.set( 4.38, 5.441, 0.088 );
this.add( light4 );
// -z
const light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );
light5.position.set( 3.235, 11.486, - 12.541 );
light5.scale.set( 2.5, 2.0, 0.1 );
this.add( light5 );
// +y
const light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );
light6.position.set( 0.0, 20.0, 0.0 );
light6.scale.set( 1.0, 0.1, 1.0 );
this.add( light6 );
}
}
function createAreaLightMaterial( intensity ) {
const material = new MeshBasicMaterial();
material.color.setScalar( intensity );
return material;
}
export { RoomEnvironment };

View File

@ -1,63 +0,0 @@
( function () {
class ShaderPass extends THREE.Pass {
constructor( shader, textureID ) {
super();
this.textureID = textureID !== undefined ? textureID : 'tDiffuse';
if ( shader instanceof THREE.ShaderMaterial ) {
this.uniforms = shader.uniforms;
this.material = shader;
} else if ( shader ) {
this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
this.material = new THREE.ShaderMaterial( {
defines: Object.assign( {}, shader.defines ),
uniforms: this.uniforms,
vertexShader: shader.vertexShader,
fragmentShader: shader.fragmentShader
} );
}
this.fsQuad = new THREE.FullScreenQuad( this.material );
}
render( renderer, writeBuffer, readBuffer
/*, deltaTime, maskActive */
) {
if ( this.uniforms[ this.textureID ] ) {
this.uniforms[ this.textureID ].value = readBuffer.texture;
}
this.fsQuad.material = this.material;
if ( this.renderToScreen ) {
renderer.setRenderTarget( null );
this.fsQuad.render( renderer );
} else {
renderer.setRenderTarget( writeBuffer ); // TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
this.fsQuad.render( renderer );
}
}
}
THREE.ShaderPass = ShaderPass;
} )();

14
3d/lib/dat.gui.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,104 +0,0 @@
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m<f.length?{done:!1,value:f[m++]}:{done:!0}}};$jscomp.arrayIterator=function(f){return{next:$jscomp.arrayIteratorImpl(f)}};$jscomp.makeIterator=function(f){var m="undefined"!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];return m?m.call(f):$jscomp.arrayIterator(f)};
$jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,m,v){f!=Array.prototype&&f!=Object.prototype&&(f[m]=v.value)};
$jscomp.polyfill=function(f,m,v,t){if(m){v=$jscomp.global;f=f.split(".");for(t=0;t<f.length-1;t++){var h=f[t];h in v||(v[h]={});v=v[h]}f=f[f.length-1];t=v[f];m=m(t);m!=t&&null!=m&&$jscomp.defineProperty(v,f,{configurable:!0,writable:!0,value:m})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(f){function m(){this.batch_=null}function v(e){return e instanceof h?e:new h(function(l,f){l(e)})}if(f&&!$jscomp.FORCE_POLYFILL_PROMISE)return f;m.prototype.asyncExecute=function(e){if(null==this.batch_){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(e)};var t=$jscomp.global.setTimeout;m.prototype.asyncExecuteFunction=function(e){t(e,0)};m.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var e=
this.batch_;this.batch_=[];for(var l=0;l<e.length;++l){var f=e[l];e[l]=null;try{f()}catch(z){this.asyncThrow_(z)}}}this.batch_=null};m.prototype.asyncThrow_=function(e){this.asyncExecuteFunction(function(){throw e;})};var h=function(e){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var l=this.createResolveAndReject_();try{e(l.resolve,l.reject)}catch(S){l.reject(S)}};h.prototype.createResolveAndReject_=function(){function e(e){return function(h){f||(f=!0,e.call(l,h))}}var l=this,f=!1;
return{resolve:e(this.resolveTo_),reject:e(this.reject_)}};h.prototype.resolveTo_=function(e){if(e===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof h)this.settleSameAsPromise_(e);else{a:switch(typeof e){case "object":var l=null!=e;break a;case "function":l=!0;break a;default:l=!1}l?this.resolveToNonPromiseObj_(e):this.fulfill_(e)}};h.prototype.resolveToNonPromiseObj_=function(e){var l=void 0;try{l=e.then}catch(S){this.reject_(S);return}"function"==typeof l?
this.settleSameAsThenable_(l,e):this.fulfill_(e)};h.prototype.reject_=function(e){this.settle_(2,e)};h.prototype.fulfill_=function(e){this.settle_(1,e)};h.prototype.settle_=function(e,l){if(0!=this.state_)throw Error("Cannot settle("+e+", "+l+"): Promise already settled in state"+this.state_);this.state_=e;this.result_=l;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var e=0;e<this.onSettledCallbacks_.length;++e)X.asyncExecute(this.onSettledCallbacks_[e]);
this.onSettledCallbacks_=null}};var X=new m;h.prototype.settleSameAsPromise_=function(e){var l=this.createResolveAndReject_();e.callWhenSettled_(l.resolve,l.reject)};h.prototype.settleSameAsThenable_=function(e,l){var f=this.createResolveAndReject_();try{e.call(l,f.resolve,f.reject)}catch(z){f.reject(z)}};h.prototype.then=function(e,f){function l(e,f){return"function"==typeof e?function(f){try{m(e(f))}catch(p){v(p)}}:f}var m,v,t=new h(function(e,f){m=e;v=f});this.callWhenSettled_(l(e,m),l(f,v));return t};
h.prototype.catch=function(e){return this.then(void 0,e)};h.prototype.callWhenSettled_=function(e,f){function l(){switch(h.state_){case 1:e(h.result_);break;case 2:f(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?X.asyncExecute(l):this.onSettledCallbacks_.push(l)};h.resolve=v;h.reject=function(e){return new h(function(f,h){h(e)})};h.race=function(e){return new h(function(f,h){for(var l=$jscomp.makeIterator(e),m=l.next();!m.done;m=l.next())v(m.value).callWhenSettled_(f,
h)})};h.all=function(e){var f=$jscomp.makeIterator(e),m=f.next();return m.done?v([]):new h(function(e,h){function l(f){return function(h){t[f]=h;z--;0==z&&e(t)}}var t=[],z=0;do t.push(void 0),z++,v(m.value).callWhenSettled_(l(t.length-1),h),m=f.next();while(!m.done)})};return h},"es6","es3");
var DracoDecoderModule=function(){var f="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;"undefined"!==typeof __filename&&(f=f||__filename);return function(m){function v(k){return a.locateFile?a.locateFile(k,M):M+k}function t(a,c){a||z("Assertion failed: "+c)}function h(a,c,b){var d=c+b;for(b=c;a[b]&&!(b>=d);)++b;if(16<b-c&&a.subarray&&xa)return xa.decode(a.subarray(c,b));for(d="";c<b;){var k=a[c++];if(k&128){var e=a[c++]&63;if(192==(k&224))d+=String.fromCharCode((k&
31)<<6|e);else{var f=a[c++]&63;k=224==(k&240)?(k&15)<<12|e<<6|f:(k&7)<<18|e<<12|f<<6|a[c++]&63;65536>k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0<a%c&&(a+=c-a%c);return a}function l(k){ka=k;a.HEAP8=T=new Int8Array(k);a.HEAP16=new Int16Array(k);a.HEAP32=P=new Int32Array(k);a.HEAPU8=ca=new Uint8Array(k);a.HEAPU16=new Uint16Array(k);a.HEAPU32=new Uint32Array(k);
a.HEAPF32=new Float32Array(k);a.HEAPF64=new Float64Array(k)}function S(k){for(;0<k.length;){var c=k.shift();if("function"==typeof c)c();else{var b=c.func;"number"===typeof b?void 0===c.arg?a.dynCall_v(b):a.dynCall_vi(b,c.arg):b(void 0===c.arg?null:c.arg)}}}function z(k){if(a.onAbort)a.onAbort(k);k+="";ya(k);Y(k);za=!0;throw new WebAssembly.RuntimeError("abort("+k+"). Build with -s ASSERTIONS=1 for more info.");}function va(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):
0===a.indexOf("data:application/octet-stream;base64,")}function wa(){try{if(da)return new Uint8Array(da);if(la)return la(U);throw"both async and sync fetching of the wasm failed";}catch(k){z(k)}}function Ma(){return da||!ea&&!Z||"function"!==typeof fetch?new Promise(function(a,c){a(wa())}):fetch(U,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+U+"'";return a.arrayBuffer()}).catch(function(){return wa()})}function ba(){if(!ba.strings){var a={USER:"web_user",
LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na},c;for(c in Aa)a[c]=Aa[c];var b=[];for(c in a)b.push(c+"="+a[c]);ba.strings=b}return ba.strings}function ma(k){function c(){if(!fa&&(fa=!0,!za)){Ba=!0;S(Ca);S(Da);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ea.unshift(a.postRun.shift());
S(Ea)}}if(!(0<aa)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Fa.unshift(a.preRun.shift());S(Fa);0<aa||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);c()},1)):c())}}function p(){}function u(a){return(a||p).__cache__}function N(a,c){var b=u(c),d=b[a];if(d)return d;d=Object.create((c||p).prototype);d.ptr=a;return b[a]=d}function V(a){if("string"===typeof a){for(var c=0,b=0;b<a.length;++b){var d=a.charCodeAt(b);
55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0<d){d=b+d-1;for(var k=0;k<a.length;++k){var e=a.charCodeAt(k);if(55296<=e&&57343>=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128|
e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr=
Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]=
this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&3>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};var ha={},W;for(W in a)a.hasOwnProperty(W)&&(ha[W]=a[W]);var na="./this.program",
ea=!1,Z=!1,oa=!1,fb=!1,Ia=!1;ea="object"===typeof window;Z="function"===typeof importScripts;oa=(fb="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ea&&!Z;Ia=!ea&&!oa&&!Z;var M="",pa,qa;if(oa){M=__dirname+"/";var ra=function(a,c){pa||(pa=require("fs"));qa||(qa=require("path"));a=qa.normalize(a);return pa.readFileSync(a,c?null:"utf8")};var la=function(a){a=ra(a,!0);a.buffer||(a=new Uint8Array(a));t(a.buffer);return a};1<process.argv.length&&
(na=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);process.on("uncaughtException",function(a){throw a;});process.on("unhandledRejection",z);a.inspect=function(){return"[Emscripten Module object]"}}else if(Ia)"undefined"!=typeof read&&(ra=function(a){return read(a)}),la=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");t("object"===typeof a);return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,
console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||Z)Z?M=self.location.href:document.currentScript&&(M=document.currentScript.src),f&&(M=f),M=0!==M.indexOf("blob:")?M.substr(0,M.lastIndexOf("/")+1):"",ra=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},Z&&(la=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)});var ya=a.print||console.log.bind(console),
Y=a.printErr||console.warn.bind(console);for(W in ha)ha.hasOwnProperty(W)&&(a[W]=ha[W]);ha=null;a.thisProgram&&(na=a.thisProgram);var da;a.wasmBinary&&(da=a.wasmBinary);"object"!==typeof WebAssembly&&Y("no native wasm support detected");var ia,gb=new WebAssembly.Table({initial:293,maximum:293,element:"anyfunc"}),za=!1,xa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var T,ca,P,Ja=a.TOTAL_MEMORY||16777216;if(ia=a.wasmMemory?
a.wasmMemory:new WebAssembly.Memory({initial:Ja/65536}))var ka=ia.buffer;Ja=ka.byteLength;l(ka);P[3416]=5256704;var Fa=[],Ca=[],Da=[],Ea=[],Ba=!1,aa=0,sa=null,ja=null;a.preloadedImages={};a.preloadedAudios={};var U="draco_decoder.wasm";va(U)||(U=v(U));Ca.push({func:function(){hb()}});var Aa={},R={buffers:[null,[],[]],printChar:function(a,c){var b=R.buffers[a];0===c||10===c?((1===a?ya:Y)(h(b,0)),b.length=0):b.push(c)},varargs:0,get:function(a){R.varargs+=4;return P[R.varargs-4>>2]},getStr:function(){return X(R.get())},
get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 13664},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112<a)return!1;for(var c=Math.max(T.length,16777216);c<a;)c=536870912>=
c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f<d.length;++f)T[e++>>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a,
c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f<b;f++){for(var g=P[c+8*f>>2],k=P[c+(8*f+4)>>2],h=0;h<k;h++)R.printChar(a,ca[g+h]);e+=k}P[d>>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)}
function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U,
{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null,
arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,
arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,
arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,
arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,
arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0=
function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,
arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,
arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=
function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},
Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},
Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,
arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=
function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,
arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1=
function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,
arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,
arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,
arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2=
function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,
arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=
function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,
arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},
Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc=
a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null,
arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},
Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,
arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null,
arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=
function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,
arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,
arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,
arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,
arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,
arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=
function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv=
function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)};
a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a);
else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ma();p.prototype=Object.create(p.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.WrapperObject=p;a.getCache=u;a.wrapPointer=N;a.castObject=function(a,b){return N(a.ptr,b)};a.NULL=N(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";
a.__destroy__();delete u(a.__class__)[a.ptr]};a.compare=function(a,b){return a.ptr===b.ptr};a.getPointer=function(a){return a.ptr};a.getClass=function(a){return a.__class__};var n={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(n.needed){for(var c=0;c<n.temps.length;c++)a._free(n.temps[c]);n.temps.length=0;a._free(n.buffer);n.buffer=0;n.size+=n.needed;n.needed=0}n.buffer||(n.size+=128,n.buffer=a._malloc(n.size),t(n.buffer));n.pos=0},alloc:function(c,b){t(n.buffer);c=c.length*b.BYTES_PER_ELEMENT;
c=c+7&-8;n.pos+c>=n.size?(t(0<c),n.needed+=c,b=a._malloc(c),n.temps.push(b)):(b=n.buffer+n.pos,n.pos+=c);return b},copy:function(a,b,d){switch(b.BYTES_PER_ELEMENT){case 2:d>>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c<a.length;c++)b[d+c]=a[c]}};x.prototype=Object.create(p.prototype);x.prototype.constructor=x;x.prototype.__class__=x;x.__cache__={};a.Status=x;x.prototype.code=x.prototype.code=function(){return jb(this.ptr)};x.prototype.ok=x.prototype.ok=function(){return!!kb(this.ptr)};x.prototype.error_msg=
x.prototype.error_msg=function(){return X(lb(this.ptr))};x.prototype.__destroy__=x.prototype.__destroy__=function(){mb(this.ptr)};A.prototype=Object.create(p.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.DracoUInt16Array=A;A.prototype.GetValue=A.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return nb(c,a)};A.prototype.size=A.prototype.size=function(){return ob(this.ptr)};A.prototype.__destroy__=A.prototype.__destroy__=function(){pb(this.ptr)};
B.prototype=Object.create(p.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.PointCloud=B;B.prototype.num_attributes=B.prototype.num_attributes=function(){return qb(this.ptr)};B.prototype.num_points=B.prototype.num_points=function(){return rb(this.ptr)};B.prototype.__destroy__=B.prototype.__destroy__=function(){sb(this.ptr)};C.prototype=Object.create(p.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.DracoUInt8Array=C;C.prototype.GetValue=
C.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return tb(c,a)};C.prototype.size=C.prototype.size=function(){return ub(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){vb(this.ptr)};D.prototype=Object.create(p.prototype);D.prototype.constructor=D;D.prototype.__class__=D;D.__cache__={};a.DracoUInt32Array=D;D.prototype.GetValue=D.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return wb(c,a)};D.prototype.size=D.prototype.size=
function(){return xb(this.ptr)};D.prototype.__destroy__=D.prototype.__destroy__=function(){yb(this.ptr)};E.prototype=Object.create(p.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.AttributeOctahedronTransform=E;E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!zb(c,a)};E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Ab(this.ptr)};E.prototype.__destroy__=E.prototype.__destroy__=
function(){Bb(this.ptr)};q.prototype=Object.create(p.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.PointAttribute=q;q.prototype.size=q.prototype.size=function(){return Cb(this.ptr)};q.prototype.GetAttributeTransformData=q.prototype.GetAttributeTransformData=function(){return N(Db(this.ptr),J)};q.prototype.attribute_type=q.prototype.attribute_type=function(){return Eb(this.ptr)};q.prototype.data_type=q.prototype.data_type=function(){return Fb(this.ptr)};q.prototype.num_components=
q.prototype.num_components=function(){return Gb(this.ptr)};q.prototype.normalized=q.prototype.normalized=function(){return!!Hb(this.ptr)};q.prototype.byte_stride=q.prototype.byte_stride=function(){return Ib(this.ptr)};q.prototype.byte_offset=q.prototype.byte_offset=function(){return Jb(this.ptr)};q.prototype.unique_id=q.prototype.unique_id=function(){return Kb(this.ptr)};q.prototype.__destroy__=q.prototype.__destroy__=function(){Lb(this.ptr)};J.prototype=Object.create(p.prototype);J.prototype.constructor=
J;J.prototype.__class__=J;J.__cache__={};a.AttributeTransformData=J;J.prototype.transform_type=J.prototype.transform_type=function(){return Mb(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){Nb(this.ptr)};w.prototype=Object.create(p.prototype);w.prototype.constructor=w;w.prototype.__class__=w;w.__cache__={};a.AttributeQuantizationTransform=w;w.prototype.InitFromAttribute=w.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!Ob(c,a)};
w.prototype.quantization_bits=w.prototype.quantization_bits=function(){return Pb(this.ptr)};w.prototype.min_value=w.prototype.min_value=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Qb(c,a)};w.prototype.range=w.prototype.range=function(){return Rb(this.ptr)};w.prototype.__destroy__=w.prototype.__destroy__=function(){Sb(this.ptr)};F.prototype=Object.create(p.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.DracoInt8Array=F;F.prototype.GetValue=F.prototype.GetValue=
function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(c,a)};F.prototype.size=F.prototype.size=function(){return Ub(this.ptr)};F.prototype.__destroy__=F.prototype.__destroy__=function(){Vb(this.ptr)};r.prototype=Object.create(p.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasEntry=r.prototype.HasEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return!!Wb(c,
a,b)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Xb(c,a,b)};r.prototype.GetIntEntryArray=r.prototype.GetIntEntryArray=function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d&&"object"===typeof d&&(d=d.ptr);Yb(c,a,b,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===
typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Zb(c,a,b)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return X($b(c,a,b))};r.prototype.NumEntries=r.prototype.NumEntries=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return ac(c,a)};r.prototype.GetEntryName=r.prototype.GetEntryName=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===
typeof b&&(b=b.ptr);return X(bc(c,a,b))};r.prototype.__destroy__=r.prototype.__destroy__=function(){cc(this.ptr)};G.prototype=Object.create(p.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.DracoInt16Array=G;G.prototype.GetValue=G.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return dc(c,a)};G.prototype.size=G.prototype.size=function(){return ec(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){fc(this.ptr)};H.prototype=
Object.create(p.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.DracoFloat32Array=H;H.prototype.GetValue=H.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return gc(c,a)};H.prototype.size=H.prototype.size=function(){return hc(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){ic(this.ptr)};O.prototype=Object.create(p.prototype);O.prototype.constructor=O;O.prototype.__class__=O;O.__cache__={};a.GeometryAttribute=O;O.prototype.__destroy__=
O.prototype.__destroy__=function(){jc(this.ptr)};K.prototype=Object.create(p.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.DecoderBuffer=K;K.prototype.Init=K.prototype.Init=function(a,b){var c=this.ptr;n.prepare();if("object"==typeof a&&"object"===typeof a){var e=n.alloc(a,T);n.copy(a,T,e);a=e}b&&"object"===typeof b&&(b=b.ptr);kc(c,a,b)};K.prototype.__destroy__=K.prototype.__destroy__=function(){lc(this.ptr)};g.prototype=Object.create(p.prototype);g.prototype.constructor=
g;g.prototype.__class__=g;g.__cache__={};a.Decoder=g;g.prototype.GetEncodedGeometryType=g.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return mc(c,a)};g.prototype.DecodeBufferToPointCloud=g.prototype.DecodeBufferToPointCloud=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(nc(c,a,b),x)};g.prototype.DecodeBufferToMesh=g.prototype.DecodeBufferToMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(oc(c,a,b),x)};g.prototype.GetAttributeId=g.prototype.GetAttributeId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return pc(c,a,b)};g.prototype.GetAttributeIdByName=g.prototype.GetAttributeIdByName=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return qc(c,a,b)};g.prototype.GetAttributeIdByMetadataEntry=g.prototype.GetAttributeIdByMetadataEntry=
function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d=d&&"object"===typeof d?d.ptr:V(d);return rc(c,a,b,d)};g.prototype.GetAttribute=g.prototype.GetAttribute=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(sc(c,a,b),q)};g.prototype.GetAttributeByUniqueId=g.prototype.GetAttributeByUniqueId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);
return N(tc(c,a,b),q)};g.prototype.GetMetadata=g.prototype.GetMetadata=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return N(uc(c,a),L)};g.prototype.GetAttributeMetadata=g.prototype.GetAttributeMetadata=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(vc(c,a,b),L)};g.prototype.GetFaceFromMesh=g.prototype.GetFaceFromMesh=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===
typeof d&&(d=d.ptr);return!!wc(c,a,b,d)};g.prototype.GetTriangleStripsFromMesh=g.prototype.GetTriangleStripsFromMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return xc(c,a,b)};g.prototype.GetTrianglesUInt16Array=g.prototype.GetTrianglesUInt16Array=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!yc(c,a,b,d)};g.prototype.GetTrianglesUInt32Array=g.prototype.GetTrianglesUInt32Array=
function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!zc(c,a,b,d)};g.prototype.GetAttributeFloat=g.prototype.GetAttributeFloat=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ac(c,a,b,d)};g.prototype.GetAttributeFloatForAllPoints=g.prototype.GetAttributeFloatForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Bc(c,a,b,d)};g.prototype.GetAttributeIntForAllPoints=g.prototype.GetAttributeIntForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Cc(c,a,b,d)};g.prototype.GetAttributeInt8ForAllPoints=g.prototype.GetAttributeInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&
(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Dc(c,a,b,d)};g.prototype.GetAttributeUInt8ForAllPoints=g.prototype.GetAttributeUInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ec(c,a,b,d)};g.prototype.GetAttributeInt16ForAllPoints=g.prototype.GetAttributeInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&
(d=d.ptr);return!!Fc(c,a,b,d)};g.prototype.GetAttributeUInt16ForAllPoints=g.prototype.GetAttributeUInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Gc(c,a,b,d)};g.prototype.GetAttributeInt32ForAllPoints=g.prototype.GetAttributeInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Hc(c,
a,b,d)};g.prototype.GetAttributeUInt32ForAllPoints=g.prototype.GetAttributeUInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ic(c,a,b,d)};g.prototype.GetAttributeDataArrayForAllPoints=g.prototype.GetAttributeDataArrayForAllPoints=function(a,b,d,e,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&
(e=e.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Jc(c,a,b,d,e,f)};g.prototype.SkipAttributeTransform=g.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Kc(b,a)};g.prototype.__destroy__=g.prototype.__destroy__=function(){Lc(this.ptr)};y.prototype=Object.create(p.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.Mesh=y;y.prototype.num_faces=y.prototype.num_faces=function(){return Mc(this.ptr)};y.prototype.num_attributes=y.prototype.num_attributes=
function(){return Nc(this.ptr)};y.prototype.num_points=y.prototype.num_points=function(){return Oc(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){Pc(this.ptr)};Q.prototype=Object.create(p.prototype);Q.prototype.constructor=Q;Q.prototype.__class__=Q;Q.__cache__={};a.VoidPtr=Q;Q.prototype.__destroy__=Q.prototype.__destroy__=function(){Qc(this.ptr)};I.prototype=Object.create(p.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoInt32Array=I;I.prototype.GetValue=
I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Rc(b,a)};I.prototype.size=I.prototype.size=function(){return Sc(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){Tc(this.ptr)};L.prototype=Object.create(p.prototype);L.prototype.constructor=L;L.prototype.__class__=L;L.__cache__={};a.Metadata=L;L.prototype.__destroy__=L.prototype.__destroy__=function(){Uc(this.ptr)};(function(){function c(){a.OK=Vc();a.DRACO_ERROR=Wc();a.IO_ERROR=Xc();a.INVALID_PARAMETER=
Yc();a.UNSUPPORTED_VERSION=Zc();a.UNKNOWN_VERSION=$c();a.DT_INVALID=ad();a.DT_INT8=bd();a.DT_UINT8=cd();a.DT_INT16=dd();a.DT_UINT16=ed();a.DT_INT32=fd();a.DT_UINT32=gd();a.DT_INT64=hd();a.DT_UINT64=id();a.DT_FLOAT32=jd();a.DT_FLOAT64=kd();a.DT_BOOL=ld();a.DT_TYPES_COUNT=md();a.INVALID_GEOMETRY_TYPE=nd();a.POINT_CLOUD=od();a.TRIANGULAR_MESH=pd();a.ATTRIBUTE_INVALID_TRANSFORM=qd();a.ATTRIBUTE_NO_TRANSFORM=rd();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=sd();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=td();a.INVALID=ud();
a.POSITION=vd();a.NORMAL=wd();a.COLOR=xd();a.TEX_COORD=yd();a.GENERIC=zd()}Ba?c():Da.unshift(c)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return m}}();"object"===typeof exports&&"object"===typeof module?module.exports=DracoDecoderModule:"function"===typeof define&&define.amd?define([],function(){return DracoDecoderModule}):"object"===typeof exports&&(exports.DracoDecoderModule=DracoDecoderModule);

View File

@ -1,167 +0,0 @@
var Stats = function () {
var mode = 0;
var container = document.createElement( 'div' );
container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
container.addEventListener( 'click', function ( event ) {
event.preventDefault();
showPanel( ++ mode % container.children.length );
}, false );
//
function addPanel( panel ) {
container.appendChild( panel.dom );
return panel;
}
function showPanel( id ) {
for ( var i = 0; i < container.children.length; i ++ ) {
container.children[ i ].style.display = i === id ? 'block' : 'none';
}
mode = id;
}
//
var beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;
var fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );
var msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );
if ( self.performance && self.performance.memory ) {
var memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );
}
showPanel( 0 );
return {
REVISION: 16,
dom: container,
addPanel: addPanel,
showPanel: showPanel,
begin: function () {
beginTime = ( performance || Date ).now();
},
end: function () {
frames ++;
var time = ( performance || Date ).now();
msPanel.update( time - beginTime, 200 );
if ( time >= prevTime + 1000 ) {
fpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );
prevTime = time;
frames = 0;
if ( memPanel ) {
var memory = performance.memory;
memPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );
}
}
return time;
},
update: function () {
beginTime = this.end();
},
// Backwards Compatibility
domElement: container,
setMode: showPanel
};
};
Stats.Panel = function ( name, fg, bg ) {
var min = Infinity, max = 0, round = Math.round;
var PR = round( window.devicePixelRatio || 1 );
var WIDTH = 80 * PR, HEIGHT = 48 * PR,
TEXT_X = 3 * PR, TEXT_Y = 2 * PR,
GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,
GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;
var canvas = document.createElement( 'canvas' );
canvas.width = WIDTH;
canvas.height = HEIGHT;
canvas.style.cssText = 'width:80px;height:48px';
var context = canvas.getContext( '2d' );
context.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';
context.textBaseline = 'top';
context.fillStyle = bg;
context.fillRect( 0, 0, WIDTH, HEIGHT );
context.fillStyle = fg;
context.fillText( name, TEXT_X, TEXT_Y );
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
context.fillStyle = bg;
context.globalAlpha = 0.9;
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
return {
dom: canvas,
update: function ( value, maxValue ) {
min = Math.min( min, value );
max = Math.max( max, value );
context.fillStyle = bg;
context.globalAlpha = 1;
context.fillRect( 0, 0, WIDTH, GRAPH_Y );
context.fillStyle = fg;
context.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );
context.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );
context.fillStyle = bg;
context.globalAlpha = 0.9;
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );
}
};
};
export default Stats;

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -30,8 +30,6 @@ RUN dotnet publish "IoTGateway.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY drivers /app/drivers/
COPY 3d /app/wwwroot/3d/
COPY --from=publish /app/publish .
ENV TZ=Asia/Shanghai

Binary file not shown.

View File

@ -80,7 +80,7 @@ namespace IoTGateway.DataAccess
{
public DataContext CreateDbContext(string[] args)
{
return new DataContext("Data Source = ../IoTGateway/data/iotgateway.db", DBTypeEnum.SQLite);
return new DataContext("server=127.0.0.1;database=iotgateway;user=iot;CharSet=utf8mb4;password=iot123456;port=3306;Allow User Variables=True;", DBTypeEnum.MySql);
}
}

View File

@ -1,794 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211209085327_ini")]
partial class ini
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.9");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.Property<double>("ValueFactor")
.HasColumnType("REAL");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,462 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTGateway.DataAccess.Migrations
{
public partial class ini : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ActionLogs",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
ModuleName = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
ActionName = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
ITCode = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
ActionUrl = table.Column<string>(type: "TEXT", maxLength: 250, nullable: true),
ActionTime = table.Column<DateTime>(type: "TEXT", nullable: false),
Duration = table.Column<double>(type: "REAL", nullable: false),
Remark = table.Column<string>(type: "TEXT", nullable: true),
IP = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
LogType = table.Column<int>(type: "INTEGER", nullable: false),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ActionLogs", x => x.ID);
});
migrationBuilder.CreateTable(
name: "DataPrivileges",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
UserCode = table.Column<string>(type: "TEXT", nullable: true),
GroupCode = table.Column<string>(type: "TEXT", nullable: true),
TableName = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
RelateId = table.Column<string>(type: "TEXT", nullable: true),
Domain = table.Column<string>(type: "TEXT", nullable: true),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DataPrivileges", x => x.ID);
});
migrationBuilder.CreateTable(
name: "Drivers",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
DriverName = table.Column<string>(type: "TEXT", nullable: true),
FileName = table.Column<string>(type: "TEXT", nullable: true),
AssembleName = table.Column<string>(type: "TEXT", nullable: true),
AuthorizesNum = table.Column<int>(type: "INTEGER", nullable: false),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Drivers", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FileAttachments",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
FileName = table.Column<string>(type: "TEXT", nullable: false),
FileExt = table.Column<string>(type: "TEXT", maxLength: 10, nullable: false),
Path = table.Column<string>(type: "TEXT", nullable: true),
Length = table.Column<long>(type: "INTEGER", nullable: false),
UploadTime = table.Column<DateTime>(type: "TEXT", nullable: false),
SaveMode = table.Column<string>(type: "TEXT", nullable: true),
FileData = table.Column<byte[]>(type: "BLOB", nullable: true),
ExtraInfo = table.Column<string>(type: "TEXT", nullable: true),
HandlerInfo = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FileAttachments", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FrameworkGroups",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
GroupCode = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
GroupName = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
GroupRemark = table.Column<string>(type: "TEXT", nullable: true),
TenantCode = table.Column<string>(type: "TEXT", nullable: true),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkGroups", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FrameworkMenus",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
PageName = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
ActionName = table.Column<string>(type: "TEXT", nullable: true),
ModuleName = table.Column<string>(type: "TEXT", nullable: true),
FolderOnly = table.Column<bool>(type: "INTEGER", nullable: false),
IsInherit = table.Column<bool>(type: "INTEGER", nullable: false),
ClassName = table.Column<string>(type: "TEXT", nullable: true),
MethodName = table.Column<string>(type: "TEXT", nullable: true),
Domain = table.Column<string>(type: "TEXT", nullable: true),
ShowOnMenu = table.Column<bool>(type: "INTEGER", nullable: false),
IsPublic = table.Column<bool>(type: "INTEGER", nullable: false),
DisplayOrder = table.Column<int>(type: "INTEGER", nullable: false),
IsInside = table.Column<bool>(type: "INTEGER", nullable: false),
Url = table.Column<string>(type: "TEXT", nullable: true),
Icon = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
ParentId = table.Column<Guid>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkMenus", x => x.ID);
table.ForeignKey(
name: "FK_FrameworkMenus_FrameworkMenus_ParentId",
column: x => x.ParentId,
principalTable: "FrameworkMenus",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "FrameworkRoles",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
RoleCode = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
RoleName = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
RoleRemark = table.Column<string>(type: "TEXT", nullable: true),
TenantCode = table.Column<string>(type: "TEXT", nullable: true),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkRoles", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FrameworkUserGroups",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
UserCode = table.Column<string>(type: "TEXT", nullable: false),
GroupCode = table.Column<string>(type: "TEXT", nullable: false),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkUserGroups", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FrameworkUserRoles",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
UserCode = table.Column<string>(type: "TEXT", nullable: false),
RoleCode = table.Column<string>(type: "TEXT", nullable: false),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkUserRoles", x => x.ID);
});
migrationBuilder.CreateTable(
name: "PersistedGrants",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
Type = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UserCode = table.Column<string>(type: "TEXT", nullable: true),
CreationTime = table.Column<DateTime>(type: "TEXT", nullable: false),
Expiration = table.Column<DateTime>(type: "TEXT", nullable: false),
RefreshToken = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PersistedGrants", x => x.ID);
});
migrationBuilder.CreateTable(
name: "SystemConfig",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
GatewayName = table.Column<string>(type: "TEXT", nullable: true),
MqttIp = table.Column<string>(type: "TEXT", nullable: true),
MqttPort = table.Column<int>(type: "INTEGER", nullable: false),
MqttUName = table.Column<string>(type: "TEXT", nullable: true),
MqttUPwd = table.Column<string>(type: "TEXT", nullable: true),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SystemConfig", x => x.ID);
});
migrationBuilder.CreateTable(
name: "Devices",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
DeviceName = table.Column<string>(type: "TEXT", nullable: true),
Index = table.Column<uint>(type: "INTEGER", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true),
DriverId = table.Column<Guid>(type: "TEXT", nullable: true),
AutoStart = table.Column<bool>(type: "INTEGER", nullable: false),
DeviceTypeEnum = table.Column<int>(type: "INTEGER", nullable: false),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", nullable: true),
ParentId = table.Column<Guid>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Devices", x => x.ID);
table.ForeignKey(
name: "FK_Devices_Devices_ParentId",
column: x => x.ParentId,
principalTable: "Devices",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Devices_Drivers_DriverId",
column: x => x.DriverId,
principalTable: "Drivers",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "FrameworkUsers",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
Email = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
Gender = table.Column<int>(type: "INTEGER", nullable: true),
CellPhone = table.Column<string>(type: "TEXT", nullable: true),
HomePhone = table.Column<string>(type: "TEXT", maxLength: 30, nullable: true),
Address = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
ZipCode = table.Column<string>(type: "TEXT", nullable: true),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
ITCode = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
Password = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
IsValid = table.Column<bool>(type: "INTEGER", nullable: false),
PhotoId = table.Column<Guid>(type: "TEXT", nullable: true),
TenantCode = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkUsers", x => x.ID);
table.ForeignKey(
name: "FK_FrameworkUsers_FileAttachments_PhotoId",
column: x => x.PhotoId,
principalTable: "FileAttachments",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "FunctionPrivileges",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
RoleCode = table.Column<string>(type: "TEXT", nullable: true),
MenuItemId = table.Column<Guid>(type: "TEXT", nullable: false),
Allowed = table.Column<bool>(type: "INTEGER", nullable: false),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FunctionPrivileges", x => x.ID);
table.ForeignKey(
name: "FK_FunctionPrivileges_FrameworkMenus_MenuItemId",
column: x => x.MenuItemId,
principalTable: "FrameworkMenus",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "DeviceConfigs",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
DeviceConfigName = table.Column<string>(type: "TEXT", nullable: true),
Description = table.Column<string>(type: "TEXT", nullable: true),
Value = table.Column<string>(type: "TEXT", nullable: true),
EnumInfo = table.Column<string>(type: "TEXT", nullable: true),
DeviceId = table.Column<Guid>(type: "TEXT", nullable: true),
CreateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
CreateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdateBy = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceConfigs", x => x.ID);
table.ForeignKey(
name: "FK_DeviceConfigs_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "DeviceVariables",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: true),
Description = table.Column<string>(type: "TEXT", nullable: true),
Method = table.Column<string>(type: "TEXT", nullable: true),
DeviceAddress = table.Column<string>(type: "TEXT", nullable: true),
DataType = table.Column<int>(type: "INTEGER", nullable: false),
ValueFactor = table.Column<double>(type: "REAL", nullable: false),
ProtectType = table.Column<int>(type: "INTEGER", nullable: false),
DeviceId = table.Column<Guid>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceVariables", x => x.ID);
table.ForeignKey(
name: "FK_DeviceVariables_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_DeviceConfigs_DeviceId",
table: "DeviceConfigs",
column: "DeviceId");
migrationBuilder.CreateIndex(
name: "IX_Devices_DriverId",
table: "Devices",
column: "DriverId");
migrationBuilder.CreateIndex(
name: "IX_Devices_ParentId",
table: "Devices",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_DeviceVariables_DeviceId",
table: "DeviceVariables",
column: "DeviceId");
migrationBuilder.CreateIndex(
name: "IX_FrameworkMenus_ParentId",
table: "FrameworkMenus",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_FrameworkUsers_PhotoId",
table: "FrameworkUsers",
column: "PhotoId");
migrationBuilder.CreateIndex(
name: "IX_FunctionPrivileges_MenuItemId",
table: "FunctionPrivileges",
column: "MenuItemId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ActionLogs");
migrationBuilder.DropTable(
name: "DataPrivileges");
migrationBuilder.DropTable(
name: "DeviceConfigs");
migrationBuilder.DropTable(
name: "DeviceVariables");
migrationBuilder.DropTable(
name: "FrameworkGroups");
migrationBuilder.DropTable(
name: "FrameworkRoles");
migrationBuilder.DropTable(
name: "FrameworkUserGroups");
migrationBuilder.DropTable(
name: "FrameworkUserRoles");
migrationBuilder.DropTable(
name: "FrameworkUsers");
migrationBuilder.DropTable(
name: "FunctionPrivileges");
migrationBuilder.DropTable(
name: "PersistedGrants");
migrationBuilder.DropTable(
name: "SystemConfig");
migrationBuilder.DropTable(
name: "Devices");
migrationBuilder.DropTable(
name: "FileAttachments");
migrationBuilder.DropTable(
name: "FrameworkMenus");
migrationBuilder.DropTable(
name: "Drivers");
}
}
}

View File

@ -1,794 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211217052811_expression")]
partial class expression
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.9");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,34 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTGateway.DataAccess.Migrations
{
public partial class expression : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ValueFactor",
table: "DeviceVariables");
migrationBuilder.AddColumn<string>(
name: "Expressions",
table: "DeviceVariables",
type: "TEXT",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Expressions",
table: "DeviceVariables");
migrationBuilder.AddColumn<double>(
name: "ValueFactor",
table: "DeviceVariables",
type: "REAL",
nullable: false,
defaultValue: 0.0);
}
}
}

View File

@ -1,797 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211220151947_disperse")]
partial class disperse
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.9");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<bool>("Disperse")
.HasColumnType("INTEGER");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,24 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTGateway.DataAccess.Migrations
{
public partial class disperse : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Disperse",
table: "SystemConfig",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Disperse",
table: "SystemConfig");
}
}
}

View File

@ -1,798 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220124063657_platforms")]
partial class platforms
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class platforms : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Disperse",
table: "SystemConfig",
newName: "IoTPlatformType");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "IoTPlatformType",
table: "SystemConfig",
newName: "Disperse");
}
}
}

View File

@ -1,801 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220323063908_attribut")]
partial class attribut
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,26 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class attribut : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "DataSide",
table: "DeviceConfigs",
type: "INTEGER",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DataSide",
table: "DeviceConfigs");
}
}
}

View File

@ -1,847 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220413084526_rpclog")]
partial class rpclog
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,48 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class rpclog : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RpcLogs",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
RpcSide = table.Column<int>(type: "INTEGER", nullable: false),
StartTime = table.Column<DateTime>(type: "TEXT", nullable: false),
DeviceId = table.Column<Guid>(type: "TEXT", nullable: true),
Method = table.Column<string>(type: "TEXT", nullable: true),
Params = table.Column<string>(type: "TEXT", nullable: true),
EndTime = table.Column<DateTime>(type: "TEXT", nullable: false),
IsSuccess = table.Column<bool>(type: "INTEGER", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RpcLogs", x => x.ID);
table.ForeignKey(
name: "FK_RpcLogs_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID");
});
migrationBuilder.CreateIndex(
name: "IX_RpcLogs_DeviceId",
table: "RpcLogs",
column: "DeviceId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RpcLogs");
}
}
}

View File

@ -1,853 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220517053158_changepublish")]
partial class changepublish
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,37 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class changepublish : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CgUpload",
table: "Devices",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<uint>(
name: "EnforcePeriod",
table: "Devices",
type: "INTEGER",
nullable: false,
defaultValue: 0u);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CgUpload",
table: "Devices");
migrationBuilder.DropColumn(
name: "EnforcePeriod",
table: "Devices");
}
}
}

View File

@ -1,856 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220810063014_mqttClientId")]
partial class mqttClientId
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class mqttClientId : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ClientId",
table: "SystemConfig",
type: "TEXT",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientId",
table: "SystemConfig");
}
}
}

View File

@ -1,859 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20220825004835_variableindex")]
partial class variableindex
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,26 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class variableindex : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<uint>(
name: "Index",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: 0u);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Index",
table: "DeviceVariables");
}
}
}

View File

@ -1,26 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class CmdPeriod : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<uint>(
name: "CmdPeriod",
table: "Devices",
type: "INTEGER",
nullable: false,
defaultValue: 0u);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CmdPeriod",
table: "Devices");
}
}
}

View File

@ -0,0 +1,551 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20221107035009_Init")]
partial class Init
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("varchar(255)");
b.Property<DateTime>("ActionTime")
.HasColumnType("datetime(6)");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<double>("Duration")
.HasColumnType("double");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("LogType")
.HasColumnType("int");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("varchar(255)");
b.Property<string>("Remark")
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Domain")
.HasColumnType("longtext");
b.Property<string>("GroupCode")
.HasColumnType("longtext");
b.Property<string>("RelateId")
.HasColumnType("longtext");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ExtraInfo")
.HasColumnType("longtext");
b.Property<byte[]>("FileData")
.HasColumnType("longblob");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("HandlerInfo")
.HasColumnType("longtext");
b.Property<long>("Length")
.HasColumnType("bigint");
b.Property<string>("Path")
.HasColumnType("longtext");
b.Property<string>("SaveMode")
.HasColumnType("longtext");
b.Property<DateTime>("UploadTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("GroupRemark")
.HasColumnType("longtext");
b.Property<string>("TenantCode")
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ActionName")
.HasColumnType("longtext");
b.Property<string>("ClassName")
.HasColumnType("longtext");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("int");
b.Property<string>("Domain")
.HasColumnType("longtext");
b.Property<bool>("FolderOnly")
.HasColumnType("tinyint(1)");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("IsInherit")
.HasColumnType("tinyint(1)");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("tinyint(1)");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<string>("MethodName")
.HasColumnType("longtext");
b.Property<string>("ModuleName")
.HasColumnType("longtext");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<bool>("ShowOnMenu")
.HasColumnType("tinyint(1)");
b.Property<string>("Url")
.HasColumnType("longtext");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("RoleRemark")
.HasColumnType("longtext");
b.Property<string>("TenantCode")
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("CellPhone")
.HasColumnType("longtext");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int?>("Gender")
.HasColumnType("int");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("varchar(30)");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("varchar(32)");
b.Property<Guid?>("PhotoId")
.HasColumnType("char(36)");
b.Property<string>("TenantCode")
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("ZipCode")
.HasColumnType("longtext");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("tinyint(1)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<Guid>("MenuItemId")
.HasColumnType("char(36)");
b.Property<string>("RoleCode")
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)");
b.Property<DateTime>("Expiration")
.HasColumnType("datetime(6)");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UserCode")
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,384 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class Init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ActionLogs",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ModuleName = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ActionName = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ITCode = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ActionUrl = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ActionTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Duration = table.Column<double>(type: "double", nullable: false),
Remark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IP = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LogType = table.Column<int>(type: "int", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ActionLogs", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DataPrivileges",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
GroupCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TableName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RelateId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Domain = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_DataPrivileges", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FileAttachments",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FileName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FileExt = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Path = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Length = table.Column<long>(type: "bigint", nullable: false),
UploadTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
SaveMode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FileData = table.Column<byte[]>(type: "longblob", nullable: true),
ExtraInfo = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
HandlerInfo = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FileAttachments", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FrameworkGroups",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GroupCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
GroupName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
GroupRemark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkGroups", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FrameworkMenus",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PageName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ActionName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ModuleName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FolderOnly = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsInherit = table.Column<bool>(type: "tinyint(1)", nullable: false),
ClassName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MethodName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Domain = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ShowOnMenu = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsPublic = table.Column<bool>(type: "tinyint(1)", nullable: false),
DisplayOrder = table.Column<int>(type: "int", nullable: false),
IsInside = table.Column<bool>(type: "tinyint(1)", nullable: false),
Url = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Icon = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ParentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkMenus", x => x.ID);
table.ForeignKey(
name: "FK_FrameworkMenus_FrameworkMenus_ParentId",
column: x => x.ParentId,
principalTable: "FrameworkMenus",
principalColumn: "ID");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FrameworkRoles",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RoleName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RoleRemark = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkRoles", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FrameworkUserGroups",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserCode = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
GroupCode = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkUserGroups", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FrameworkUserRoles",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserCode = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RoleCode = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkUserRoles", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PersistedGrants",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Expiration = table.Column<DateTime>(type: "datetime(6)", nullable: false),
RefreshToken = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_PersistedGrants", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FrameworkUsers",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Email = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Gender = table.Column<int>(type: "int", nullable: true),
CellPhone = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
HomePhone = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ZipCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ITCode = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Password = table.Column<string>(type: "varchar(32)", maxLength: 32, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsValid = table.Column<bool>(type: "tinyint(1)", nullable: false),
PhotoId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkUsers", x => x.ID);
table.ForeignKey(
name: "FK_FrameworkUsers_FileAttachments_PhotoId",
column: x => x.PhotoId,
principalTable: "FileAttachments",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FunctionPrivileges",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleCode = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MenuItemId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Allowed = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_FunctionPrivileges", x => x.ID);
table.ForeignKey(
name: "FK_FunctionPrivileges_FrameworkMenus_MenuItemId",
column: x => x.MenuItemId,
principalTable: "FrameworkMenus",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_FrameworkMenus_ParentId",
table: "FrameworkMenus",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_FrameworkUsers_PhotoId",
table: "FrameworkUsers",
column: "PhotoId");
migrationBuilder.CreateIndex(
name: "IX_FunctionPrivileges_MenuItemId",
table: "FunctionPrivileges",
column: "MenuItemId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ActionLogs");
migrationBuilder.DropTable(
name: "DataPrivileges");
migrationBuilder.DropTable(
name: "FrameworkGroups");
migrationBuilder.DropTable(
name: "FrameworkRoles");
migrationBuilder.DropTable(
name: "FrameworkUserGroups");
migrationBuilder.DropTable(
name: "FrameworkUserRoles");
migrationBuilder.DropTable(
name: "FrameworkUsers");
migrationBuilder.DropTable(
name: "FunctionPrivileges");
migrationBuilder.DropTable(
name: "PersistedGrants");
migrationBuilder.DropTable(
name: "FileAttachments");
migrationBuilder.DropTable(
name: "FrameworkMenus");
}
}
}

View File

@ -11,61 +11,63 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20221012063127_CmdPeriod")]
[Migration("20221107035318_CmdPeriod")]
partial class CmdPeriod
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder
.HasAnnotation("ProductVersion", "6.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
.HasColumnType("int unsigned");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
.HasColumnType("int unsigned");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
.HasColumnType("int unsigned");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -80,39 +82,39 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Value")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -125,34 +127,34 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
.HasColumnType("int unsigned");
b.Property<string>("Method")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("Name")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.HasKey("ID");
@ -165,33 +167,33 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("FileName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -202,31 +204,31 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Method")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("Params")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -239,42 +241,42 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -285,53 +287,53 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
.HasColumnType("varchar(255)");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
.HasColumnType("varchar(250)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<double>("Duration")
.HasColumnType("REAL");
.HasColumnType("double");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
.HasColumnType("varchar(255)");
b.Property<string>("Remark")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -342,38 +344,38 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Domain")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -384,37 +386,37 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
.HasColumnType("longblob");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
.HasColumnType("varchar(10)");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<long>("Length")
.HasColumnType("INTEGER");
.HasColumnType("bigint");
b.Property<string>("Path")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -425,37 +427,37 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
.HasColumnType("varchar(100)");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -466,57 +468,57 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("Domain")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Url")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -529,37 +531,37 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
.HasColumnType("varchar(100)");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -570,66 +572,66 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
.HasColumnType("varchar(200)");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
.HasColumnType("varchar(30)");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
.HasColumnType("varchar(32)");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -642,29 +644,29 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -675,29 +677,29 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -708,31 +710,31 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -745,24 +747,24 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");

View File

@ -0,0 +1,246 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class CmdPeriod : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Drivers",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DriverName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
FileName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AssembleName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AuthorizesNum = table.Column<int>(type: "int", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Drivers", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "SystemConfig",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GatewayName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientId = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MqttIp = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MqttPort = table.Column<int>(type: "int", nullable: false),
MqttUName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MqttUPwd = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IoTPlatformType = table.Column<int>(type: "int", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_SystemConfig", x => x.ID);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Devices",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DeviceName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Index = table.Column<uint>(type: "int unsigned", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DriverId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
AutoStart = table.Column<bool>(type: "tinyint(1)", nullable: false),
CgUpload = table.Column<bool>(type: "tinyint(1)", nullable: false),
EnforcePeriod = table.Column<uint>(type: "int unsigned", nullable: false),
CmdPeriod = table.Column<uint>(type: "int unsigned", nullable: false),
DeviceTypeEnum = table.Column<int>(type: "int", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ParentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_Devices", x => x.ID);
table.ForeignKey(
name: "FK_Devices_Devices_ParentId",
column: x => x.ParentId,
principalTable: "Devices",
principalColumn: "ID");
table.ForeignKey(
name: "FK_Devices_Drivers_DriverId",
column: x => x.DriverId,
principalTable: "Drivers",
principalColumn: "ID");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DeviceConfigs",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
DeviceConfigName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DataSide = table.Column<int>(type: "int", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
EnumInfo = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateBy = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceConfigs", x => x.ID);
table.ForeignKey(
name: "FK_DeviceConfigs_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DeviceVariables",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Method = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceAddress = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DataType = table.Column<int>(type: "int", nullable: false),
Expressions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ProtectType = table.Column<int>(type: "int", nullable: false),
Index = table.Column<uint>(type: "int unsigned", nullable: false),
DeviceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceVariables", x => x.ID);
table.ForeignKey(
name: "FK_DeviceVariables_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RpcLogs",
columns: table => new
{
ID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RpcSide = table.Column<int>(type: "int", nullable: false),
StartTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DeviceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Method = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Params = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
EndTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsSuccess = table.Column<bool>(type: "tinyint(1)", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_RpcLogs", x => x.ID);
table.ForeignKey(
name: "FK_RpcLogs_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_DeviceConfigs_DeviceId",
table: "DeviceConfigs",
column: "DeviceId");
migrationBuilder.CreateIndex(
name: "IX_Devices_DriverId",
table: "Devices",
column: "DriverId");
migrationBuilder.CreateIndex(
name: "IX_Devices_ParentId",
table: "Devices",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_DeviceVariables_DeviceId",
table: "DeviceVariables",
column: "DeviceId");
migrationBuilder.CreateIndex(
name: "IX_RpcLogs_DeviceId",
table: "RpcLogs",
column: "DeviceId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DeviceConfigs");
migrationBuilder.DropTable(
name: "DeviceVariables");
migrationBuilder.DropTable(
name: "RpcLogs");
migrationBuilder.DropTable(
name: "SystemConfig");
migrationBuilder.DropTable(
name: "Devices");
migrationBuilder.DropTable(
name: "Drivers");
}
}
}

View File

@ -1,865 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20221206143332_EndianType")]
partial class EndianType
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<int>("EndianType")
.HasColumnType("INTEGER");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,26 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class EndianType : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "EndianType",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EndianType",
table: "DeviceVariables");
}
}
}

View File

@ -1,871 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20230412061736_IsUpload")]
partial class IsUpload
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<int>("EndianType")
.HasColumnType("INTEGER");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,36 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class IsUpload : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Alias",
table: "DeviceVariables",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsUpload",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Alias",
table: "DeviceVariables");
migrationBuilder.DropColumn(
name: "IsUpload",
table: "DeviceVariables");
}
}
}

View File

@ -1,874 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240531142726_IsTrigger")]
partial class IsTrigger
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceName")
.HasColumnType("TEXT");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceConfigs");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<int>("DataType")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<int>("EndianType")
.HasColumnType("INTEGER");
b.Property<string>("Expressions")
.HasColumnType("TEXT");
b.Property<uint>("Index")
.HasColumnType("INTEGER");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("DeviceVariables");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER");
b.Property<string>("Method")
.HasColumnType("TEXT");
b.Property<string>("Params")
.HasColumnType("TEXT");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER");
b.Property<string>("MqttIp")
.HasColumnType("TEXT");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER");
b.Property<string>("MqttUName")
.HasColumnType("TEXT");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,26 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class IsTrigger : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsTrigger",
table: "DeviceVariables",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsTrigger",
table: "DeviceVariables");
}
}
}

View File

@ -1,951 +0,0 @@
// <auto-generated />
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20240719011950_CommentAndIndex")]
partial class CommentAndIndex
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER")
.HasComment("启动");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER")
.HasComment("变化上传");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER")
.HasComment("指令间隔ms");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT")
.HasComment("驱动");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER")
.HasComment("归档周期ms");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
b.HasComment("设备维护");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<int>("DataSide")
.HasColumnType("INTEGER")
.HasComment("属性侧");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT")
.HasComment("备注");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasComment("值");
b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT")
.HasComment("别名");
b.Property<int>("DataType")
.HasColumnType("INTEGER")
.HasComment("数据类型");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT")
.HasComment("地址");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<int>("EndianType")
.HasColumnType("INTEGER")
.HasComment("大小端");
b.Property<string>("Expressions")
.HasColumnType("TEXT")
.HasComment("表达式");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER")
.HasComment("触发");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER")
.HasComment("上传");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasComment("变量名");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER")
.HasComment("权限");
b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables");
b.HasComment("变量配置");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AssembleName")
.HasColumnType("TEXT")
.HasComment("程序集名");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER")
.HasComment("剩余授权数");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("DriverName")
.HasColumnType("TEXT")
.HasComment("驱动名");
b.Property<string>("FileName")
.HasColumnType("TEXT")
.HasComment("文件名");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
b.HasComment("驱动管理");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT")
.HasComment("结束时间");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER")
.HasComment("是否成功");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property<string>("Params")
.HasColumnType("TEXT")
.HasComment("请求参数");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER")
.HasComment("发起方");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT")
.HasComment("开始时间");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
b.HasComment("RPC日志");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.HasColumnType("TEXT")
.HasComment("ClientId");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GatewayName")
.HasColumnType("TEXT")
.HasComment("网关名称");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER")
.HasComment("输出平台");
b.Property<string>("MqttIp")
.HasColumnType("TEXT")
.HasComment("Mqtt服务器");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER")
.HasComment("Mqtt端口");
b.Property<string>("MqttUName")
.HasColumnType("TEXT")
.HasComment("Mqtt用户名");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT")
.HasComment("Mqtt密码");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
b.HasComment("传输配置");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<double>("Duration")
.HasColumnType("REAL");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Remark")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
b.Property<long>("Length")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("Domain")
.HasColumnType("TEXT");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property<string>("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -15,410 +15,323 @@ namespace IoTGateway.DataAccess.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder
.HasAnnotation("ProductVersion", "6.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<bool>("AutoStart")
.HasColumnType("INTEGER")
.HasComment("启动");
.HasColumnType("tinyint(1)");
b.Property<bool>("CgUpload")
.HasColumnType("INTEGER")
.HasComment("变化上传");
.HasColumnType("tinyint(1)");
b.Property<uint>("CmdPeriod")
.HasColumnType("INTEGER")
.HasComment("指令间隔ms");
.HasColumnType("int unsigned");
b.Property<string>("CreateBy")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.HasColumnType("TEXT")
.HasComment("名称");
.HasColumnType("longtext");
b.Property<int>("DeviceTypeEnum")
.HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
.HasColumnType("int");
b.Property<Guid?>("DriverId")
.HasColumnType("TEXT")
.HasComment("驱动");
.HasColumnType("char(36)");
b.Property<uint>("EnforcePeriod")
.HasColumnType("INTEGER")
.HasComment("归档周期ms");
.HasColumnType("int unsigned");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
.HasColumnType("int unsigned");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("UpdateBy")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
b.HasComment("设备维护");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<int>("DataSide")
.HasColumnType("INTEGER")
.HasComment("属性侧");
.HasColumnType("int");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
.HasColumnType("longtext");
b.Property<string>("DeviceConfigName")
.HasColumnType("TEXT")
.HasComment("名称");
.HasColumnType("longtext");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
.HasColumnType("char(36)");
b.Property<string>("EnumInfo")
.HasColumnType("TEXT")
.HasComment("备注");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Value")
.HasColumnType("TEXT")
.HasComment("值");
.HasColumnType("longtext");
b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Alias")
.HasColumnType("TEXT")
.HasComment("别名");
.HasColumnType("char(36)");
b.Property<int>("DataType")
.HasColumnType("INTEGER")
.HasComment("数据类型");
.HasColumnType("int");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
.HasColumnType("longtext");
b.Property<string>("DeviceAddress")
.HasColumnType("TEXT")
.HasComment("地址");
.HasColumnType("longtext");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property<int>("EndianType")
.HasColumnType("INTEGER")
.HasComment("大小端");
.HasColumnType("char(36)");
b.Property<string>("Expressions")
.HasColumnType("TEXT")
.HasComment("表达式");
.HasColumnType("longtext");
b.Property<uint>("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property<bool>("IsTrigger")
.HasColumnType("INTEGER")
.HasComment("触发");
b.Property<bool>("IsUpload")
.HasColumnType("INTEGER")
.HasComment("上传");
.HasColumnType("int unsigned");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
.HasColumnType("longtext");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasComment("变量名");
.HasColumnType("longtext");
b.Property<int>("ProtectType")
.HasColumnType("INTEGER")
.HasComment("权限");
.HasColumnType("int");
b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables");
b.HasComment("变量配置");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("AssembleName")
.HasColumnType("TEXT")
.HasComment("程序集名");
.HasColumnType("longtext");
b.Property<int>("AuthorizesNum")
.HasColumnType("INTEGER")
.HasComment("剩余授权数");
.HasColumnType("int");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("DriverName")
.HasColumnType("TEXT")
.HasComment("驱动名");
.HasColumnType("longtext");
b.Property<string>("FileName")
.HasColumnType("TEXT")
.HasComment("文件名");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("Drivers");
b.HasComment("驱动管理");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("Description")
.HasColumnType("TEXT")
.HasComment("描述");
.HasColumnType("longtext");
b.Property<Guid?>("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
.HasColumnType("char(36)");
b.Property<DateTime>("EndTime")
.HasColumnType("TEXT")
.HasComment("结束时间");
.HasColumnType("datetime(6)");
b.Property<bool>("IsSuccess")
.HasColumnType("INTEGER")
.HasComment("是否成功");
.HasColumnType("tinyint(1)");
b.Property<string>("Method")
.HasColumnType("TEXT")
.HasComment("方法");
.HasColumnType("longtext");
b.Property<string>("Params")
.HasColumnType("TEXT")
.HasComment("请求参数");
.HasColumnType("longtext");
b.Property<int>("RpcSide")
.HasColumnType("INTEGER")
.HasComment("发起方");
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("TEXT")
.HasComment("开始时间");
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
b.HasComment("RPC日志");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ClientId")
.HasColumnType("TEXT")
.HasComment("ClientId");
.HasColumnType("longtext");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("GatewayName")
.HasColumnType("TEXT")
.HasComment("网关名称");
.HasColumnType("longtext");
b.Property<int>("IoTPlatformType")
.HasColumnType("INTEGER")
.HasComment("输出平台");
.HasColumnType("int");
b.Property<string>("MqttIp")
.HasColumnType("TEXT")
.HasComment("Mqtt服务器");
.HasColumnType("longtext");
b.Property<int>("MqttPort")
.HasColumnType("INTEGER")
.HasComment("Mqtt端口");
.HasColumnType("int");
b.Property<string>("MqttUName")
.HasColumnType("TEXT")
.HasComment("Mqtt用户名");
.HasColumnType("longtext");
b.Property<string>("MqttUPwd")
.HasColumnType("TEXT")
.HasComment("Mqtt密码");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("SystemConfig");
b.HasComment("传输配置");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
.HasColumnType("varchar(255)");
b.Property<DateTime>("ActionTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
.HasColumnType("varchar(250)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<double>("Duration")
.HasColumnType("REAL");
.HasColumnType("double");
b.Property<string>("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<int>("LogType")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
.HasColumnType("varchar(255)");
b.Property<string>("Remark")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -429,38 +342,38 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Domain")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("GroupCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("RelateId")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -471,37 +384,37 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ExtraInfo")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<byte[]>("FileData")
.HasColumnType("BLOB");
.HasColumnType("longblob");
b.Property<string>("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
.HasColumnType("varchar(10)");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("HandlerInfo")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<long>("Length")
.HasColumnType("INTEGER");
.HasColumnType("bigint");
b.Property<string>("Path")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("SaveMode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<DateTime>("UploadTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -512,37 +425,37 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
.HasColumnType("varchar(100)");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("GroupRemark")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -553,57 +466,57 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("ActionName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("ClassName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<int?>("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("Domain")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<bool>("FolderOnly")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<bool>("IsInherit")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<bool?>("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<bool>("IsPublic")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("MethodName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("ModuleName")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<bool>("ShowOnMenu")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Url")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -616,37 +529,37 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
.HasColumnType("varchar(100)");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("RoleRemark")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -657,66 +570,66 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
.HasColumnType("varchar(200)");
b.Property<string>("CellPhone")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<int?>("Gender")
.HasColumnType("INTEGER");
.HasColumnType("int");
b.Property<string>("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
.HasColumnType("varchar(30)");
b.Property<string>("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<bool>("IsValid")
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
.HasColumnType("varchar(32)");
b.Property<Guid?>("PhotoId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("TenantCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("ZipCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -729,29 +642,29 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -762,29 +675,29 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("UserCode")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");
@ -795,31 +708,31 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<bool?>("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
.HasColumnType("tinyint(1)");
b.Property<string>("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<Guid>("MenuItemId")
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<string>("RoleCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.Property<string>("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.HasKey("ID");
@ -832,24 +745,24 @@ namespace IoTGateway.DataAccess.Migrations
{
b.Property<Guid>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<DateTime>("Expiration")
.HasColumnType("TEXT");
.HasColumnType("datetime(6)");
b.Property<string>("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
.HasColumnType("varchar(50)");
b.Property<string>("UserCode")
.HasColumnType("TEXT");
.HasColumnType("longtext");
b.HasKey("ID");

View File

@ -4,26 +4,26 @@ namespace IoTGateway.Model
{
public enum DeviceTypeEnum
{
[Display(Name = "Group")]
[Display(Name = "采集组")]
Group = 0,
[Display(Name = "Device")]
[Display(Name = "采集点")]
Device = 1
}
public enum AccessEnum
{
[Display(Name = "ReadOnly")]
[Display(Name = "只读")]
ReadOnly = 0,
[Display(Name = "ReadWrite")]
[Display(Name = "读写")]
ReadAndWrite = 1
}
public enum DataSide
{
[Display(Name = "AnySide")]
[Display(Name ="共享属性")]
AnySide=0,
//ServerSide=1,
[Display(Name = "ClientSide")]
[Display(Name = "客户端属性")]
ClientSide =2,
}
}

View File

@ -1,62 +1,47 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;
using Microsoft.EntityFrameworkCore;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("设备维护")]
[Index(nameof(DeviceName))]
[Index(nameof(AutoStart))]
[Index(nameof(DeviceTypeEnum))]
public class Device : TreePoco<Device>, IBasePoco
{
[Comment("名称")]
[Display(Name = "DeviceName")]
[Display(Name = "名称")]
public string DeviceName { get; set; }
[Comment("排序")]
[Display(Name = "Sort")]
[Display(Name = "排序")]
public uint Index { get; set; }
[Comment("描述")]
[Display(Name = "Description")]
[Display(Name = "描述")]
public string Description { get; set; }
public Driver Driver { get; set; }
[Comment("驱动")]
[Display(Name = "Driver")]
[Display(Name = "驱动")]
public Guid? DriverId { get; set; }
[Comment("启动")]
[Display(Name = "AutoStart")]
[Display(Name = "启动")]
public bool AutoStart { get; set; }
[Comment("变化上传")]
[Display(Name = "ChangeUpload")]
[Display(Name = "变化上传")]
public bool CgUpload { get; set; }
[Comment("归档周期ms")]
[Display(Name = "EnforcePeriodms")]
[Display(Name = "归档周期ms")]
public uint EnforcePeriod { get; set; }
[Comment("指令间隔ms")]
[Display(Name = "CmdPeriodms")]
[Display(Name = "指令间隔ms")]
public uint CmdPeriod { get; set; }
[Comment("类型(组或设备)")]
[Display(Name = "Type")]
[Display(Name = "类型")]
public DeviceTypeEnum DeviceTypeEnum { get; set; }
[Display(Name = "CreateTime")]
[Display(Name = "创建时间")]
public DateTime? CreateTime { get; set; }
[Display(Name = "CreateBy")]
[Display(Name = "创建人")]
public string CreateBy { get; set; }
[Display(Name = "UpdateTime")]
[Display(Name = "更新时间")]
public DateTime? UpdateTime { get; set; }
[Display(Name = "UpdateBy")]
[Display(Name = "更新人")]
public string UpdateBy { get; set; }
public List<DeviceConfig> DeviceConfigs { get; set; }

View File

@ -1,39 +1,23 @@
using Microsoft.EntityFrameworkCore;
using System;
using System;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("通讯配置")]
[Index(nameof(DeviceConfigName))]
[Index(nameof(Value))]
public class DeviceConfig : BasePoco
{
[Comment("名称")]
[Display(Name = "ConfigName")]
[Display(Name = "名称")]
public string DeviceConfigName { get; set; }
[Comment("属性侧")]
[Display(Name = "DataSide")]
[Display(Name = "属性侧")]
public DataSide DataSide { get; set; }
[Comment("描述")]
[Display(Name = "Description")]
[Display(Name = "描述")]
public string Description { get; set; }
[Comment("值")]
[Display(Name = "Value")]
[Display(Name = "值")]
public string Value { get; set; }
[Comment("备注")]
[Display(Name = "Remark")]
[Display(Name = "备注")]
public string EnumInfo { get; set; }
public Device Device { get; set; }
[Comment("所属设备")]
[Display(Name = "Device")]
[Display(Name = "设备")]
public Guid? DeviceId { get; set; }
}
}

View File

@ -1,117 +1,39 @@
using PluginInterface;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using WalkingTec.Mvvm.Core;
using Microsoft.EntityFrameworkCore;
namespace IoTGateway.Model
{
[Comment("变量配置")]
[Index(nameof(Name))]
[Index(nameof(Method))]
[Index(nameof(DeviceAddress))]
[Index(nameof(DataType))]
public class DeviceVariable : TopBasePoco, IVariable
{
[Comment("变量名")]
[Display(Name = "VariableName")]
[Display(Name = "变量名")]
public string Name { get; set; }
[Comment("描述")]
[Display(Name = "Description")]
[Display(Name = "描述")]
public string Description { get; set; }
[Comment("方法")]
[Display(Name = "Method")]
[Display(Name = "方法")]
public string Method { get; set; }
[Comment("地址")]
[Display(Name = "Address")]
[Display(Name = "地址")]
public string DeviceAddress { get; set; }
[Comment("数据类型")]
[Display(Name = "DataType")]
public DataTypeEnum DataType { get; set; }
[Display(Name = "类型")]
public PluginInterface.DataTypeEnum DataType { get; set; }
[Comment("触发")]
[Display(Name = "IsTrigger")]
public bool IsTrigger { get; set; }
[Comment("大小端")]
[Display(Name = "EndianType")]
public EndianEnum EndianType { get; set; }
[Comment("表达式")]
[Display(Name = "Expressions")]
[Display(Name = "表达式")]
public string Expressions { get; set; }
[Comment("上传")]
[Display(Name = "Upload")]
public bool IsUpload { get; set; }
[Comment("权限")]
[Display(Name = "Permissions")]
[Display(Name = "权限")]
public ProtectTypeEnum ProtectType { get; set; }
[Comment("排序")]
[Display(Name = "Sort")]
[Display(Name = "排序")]
public uint Index { get; set; }
[Newtonsoft.Json.JsonIgnore]
public Device Device { get; set; }
[Comment("所属设备")]
[Display(Name = "Device")]
[Display(Name = "设备")]
public Guid? DeviceId { get; set; }
[Comment("别名")]
[Display(Name = "Alias")]
public string Alias { get; set; }
[Comment("原值")]
[NotMapped]
[Display(Name = "RawValue")]
public object Value { get; set; }
[Comment("计算后的值")]
[NotMapped]
[Display(Name = "CookedValue")]
public object CookedValue { get; set; }
[Comment("错误信息")]
[NotMapped]
[Display(Name = "Message")]
public string Message { get; set; }
[Comment("更新时间")]
[NotMapped]
[Display(Name = "Timestamp")]
public DateTime Timestamp { get; set; }
[Comment("状态")]
[NotMapped]
[Display(Name = "Status")]
[JsonConverter(typeof(StringEnumConverter))]
public VaribaleStatusTypeEnum StatusType { get; set; } = VaribaleStatusTypeEnum.UnKnow;
[Comment("最新三次原值")]
[NotMapped][Display(Name = "MostRecentValues")] public object[] Values { get; set; } = new object[3];
[Comment("最新三次计算后的值")]
[NotMapped][Display(Name = "MostRecentCookedValues")] public object[] CookedValues { get; set; } = new object[3];
public void EnqueueVariable(object value)
{
Values[2] = Values[1];
Values[1] = Values[0];
Values[0] = value;
}
public void EnqueueCookedVariable(object value)
{
CookedValues[2] = CookedValues[1];
CookedValues[1] = CookedValues[0];
CookedValues[0] = value;
}
}
}

View File

@ -1,27 +1,18 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("驱动管理")]
public class Driver : BasePoco
{
[Comment("驱动名")]
[Display(Name = "DriverName")]
[Display(Name = "驱动名")]
public string DriverName { get; set; }
[Comment("文件名")]
[Display(Name = "FileName")]
[Display(Name = "文件名")]
public string FileName { get; set; }
[Comment("程序集名")]
[Display(Name = "AssembleName")]
[Display(Name = "程序集名")]
public string AssembleName { get; set; }
[Comment("剩余授权数")]
[Display(Name = "Remains")]
[Display(Name = "剩余授权数量")]
public int AuthorizesNum { get; set; }
}
}

View File

@ -5,22 +5,22 @@ namespace IoTGateway.Model
{
public interface IVariable
{
[Display(Name = "VariableName")]
[Display(Name = "变量名")]
public string Name { get; set; }
[Display(Name = "Description")]
[Display(Name = "描述")]
public string Description { get; set; }
[Display(Name = "Address")]
[Display(Name = "地址")]
public string DeviceAddress { get; set; }
[Display(Name = "DataType")]
[Display(Name = "数据类型")]
public PluginInterface.DataTypeEnum DataType { get; set; }
[Display(Name = "Expressions")]
[Display(Name = "表达式")]
public string Expressions { get; set; }
[Display(Name = "Permission")]
[Display(Name = "权限")]
public ProtectTypeEnum ProtectType { get; set; }
}
}

View File

@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@ -9,49 +8,40 @@ using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("RPC日志")]
public class RpcLog:TopBasePoco
{
[Comment("发起方")]
[Display(Name = "RpcSide")]
public RpcSide RpcSide { get; set; }
[Display(Name = "发起方")]
public RpcSide RpcSide { get; set; }
[Comment("开始时间")]
[Display(Name = "StartTime")]
[Display(Name = "开始时间")]
public DateTime StartTime { get; set; }
public Device Device { get; set; }
[Comment("所属设备")]
[Display(Name = "Device")]
[Display(Name = "设备名")]
public Guid? DeviceId { get; set; }
[Comment("方法")]
[Display(Name = "Method")]
[Display(Name = "方法名")]
public string Method { get; set; }
[Comment("请求参数")]
[Display(Name = "Parameters")]
[Display(Name = "请求参数")]
public string Params { get; set; }
[Comment("结束时间")]
[Display(Name = "EndTime")]
[Display(Name = "结束时间")]
public DateTime EndTime { get; set; }
[Comment("是否成功")]
[Display(Name = "IsSuccess")]
[Display(Name = "结果")]
public bool IsSuccess { get; set; }
[Comment("描述")]
[Display(Name = "Description")]
[Display(Name = "描述")]
public string Description { get; set; }
}
public enum RpcSide
{
[Display(Name = "ServerSide")]
[Display(Name ="服务端请求")]
ServerSide=1,
[Display(Name = "ClientSide")]
[Display(Name = "客户端请求")]
ClientSide =1
}
}

View File

@ -1,38 +1,23 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
namespace IoTGateway.Model
{
[Comment("传输配置")]
public class SystemConfig : BasePoco
{
[Comment("网关名称")]
[Display(Name = "GatewayName")]
[Display(Name = "网关名称")]
public string GatewayName { get; set; }
[Comment("ClientId")]
[Display(Name = "ClientId")]
public string ClientId { get; set; }
[Comment("Mqtt服务器")]
[Display(Name = "MqttServer ")]
[Display(Name = "Mqtt服务器")]
public string MqttIp { get; set; }
[Comment("Mqtt端口")]
[Display(Name = "MqttPort")]
[Display(Name = "Mqtt端口")]
public int MqttPort { get; set; }
[Comment("Mqtt用户名")]
[Display(Name = "UserName")]
[Display(Name = "Mqtt用户名")]
public string MqttUName { get; set; }
[Comment("Mqtt密码")]
[Display(Name = "Password")]
[Display(Name = "Mqtt密码")]
public string MqttUPwd { get; set; }
[Comment("输出平台")]
[Display(Name = "OutputPlatform")]
[Display(Name = "输出平台")]
public IoTPlatformType IoTPlatformType { get; set; }
}
public enum IoTPlatformType
@ -41,21 +26,19 @@ namespace IoTGateway.Model
ThingsBoard =0,
[Display(Name = "IoTSharp")]
IoTSharp =1,
[Display(Name = "AliIoT")]
[Display(Name = "阿里物联网平台")]
AliCloudIoT=2,
[Display(Name = "TencentIoTHub")]
[Display(Name = "腾讯智能云")]
TencentIoTHub =3,
[Display(Name = "BaiduIoTCore")]
[Display(Name = "百度物联网通信")]
BaiduIoTCore =4,
[Display(Name = "OneNet")]
[Display(Name = "中移OneNet")]
OneNET = 5,
[Display(Name = "ThingsCloud")]
ThingsCloud = 6,
[Display(Name = "HuaWeiCloud")]
[Display(Name = "华为云")]
HuaWei = 7,
[Display(Name = "IoTGateway")]
IoTGateway = 8,
[Display(Name = "ThingsPanel")]
ThingsPanel = 9
[Display(Name = "IotDB")]
IotDB = 99
}
}

View File

@ -20,7 +20,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceConfigVMs
{
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
//this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "BasicData", dialogWidth: 800),
//this.MakeStandardAction("DeviceConfig", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "BasicData", dialogWidth: 800),
@ -58,7 +58,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceConfigVMs
return new List<GridColumn<DeviceConfig_View>>{
this.MakeGridHeader(x => x.DeviceConfigName).SetWidth(100),
this.MakeGridHeader(x => x.DataSide).SetWidth(100),
this.MakeGridHeader(x => x.Description).SetWidth(120),
this.MakeGridHeader(x => x.Description).SetWidth(100),
this.MakeGridHeader(x => x.Value).SetWidth(100),
this.MakeGridHeader(x => x.DeviceName_view).SetWidth(100),
this.MakeGridHeader(x => x.EnumInfo),
@ -93,7 +93,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceConfigVMs
public class DeviceConfig_View : DeviceConfig
{
[Display(Name = "DeviceName")]
[Display(Name = "设备名")]
public String DeviceName_view { get; set; }
}

View File

@ -26,8 +26,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
= "复制失败,找不到设备";
else
{
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.RequestAttributes(device.DeviceName, true, device.DeviceConfigs.Where(x => x.DataSide == DataSide.AnySide).Select(x => x.DeviceConfigName).ToArray());
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.RequestAttributes(device.DeviceName, true, device.DeviceConfigs.Where(x => x.DataSide == DataSide.AnySide).Select(x => x.DeviceConfigName).ToArray());
}
DC.SaveChanges();
transaction.Commit();

View File

@ -47,7 +47,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
DriverId = device.DriverId,
Description = device.Description,
DeviceTypeEnum = device.DeviceTypeEnum,
Parent = device.Parent
Parent= device.Parent
};
DC.Set<Device>().Add(newDevice);
devices.Add(newDevice);
@ -67,7 +67,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
DC.Set<DeviceConfig>().Add(newDeviceConfig);
}
foreach (var deviceVariable in deviceVariables.OrderBy(x => x.Index))
foreach (var deviceVariable in deviceVariables)
{
var newDeviceVariable = new DeviceVariable
{
@ -75,13 +75,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
Name = deviceVariable.Name,
Description = deviceVariable.Description,
DataType = deviceVariable.DataType,
IsTrigger = deviceVariable.IsTrigger,
Method = deviceVariable.Method,
ProtectType = deviceVariable.ProtectType,
Expressions = deviceVariable.Expressions,
DeviceAddress = deviceVariable.DeviceAddress,
Index = deviceVariable.Index,
IsUpload = deviceVariable.IsUpload
DeviceAddress = deviceVariable.DeviceAddress
};
DC.Set<DeviceVariable>().Add(newDeviceVariable);

View File

@ -38,10 +38,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
var dapConfigs = DC.Set<DeviceConfig>().Where(x => x.DeviceId == dap.ID).ToList();
var dapVariables = DC.Set<DeviceVariable>().Where(x => x.DeviceId == dap.ID).ToList();
var rpcs = DC.Set<RpcLog>().Where(x => x.DeviceId == dap.ID).ToList();
DC.Set<DeviceConfig>().RemoveRange(dapConfigs);
DC.Set<DeviceVariable>().RemoveRange(dapVariables);
DC.Set<RpcLog>().RemoveRange(rpcs);
}
pluginManager.RemoveDeviceThread(dap);
}

View File

@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiBatchVM : BaseBatchVM<Device, DeviceApi_BatchEdit>
{
public DeviceApiBatchVM()
{
ListVM = new DeviceApiListVM();
LinkedVM = new DeviceApi_BatchEdit();
}
}
/// <summary>
/// Class to define batch edit fields
/// </summary>
public class DeviceApi_BatchEdit : BaseVM
{
[Display(Name = "AutoStart")]
public Boolean? AutoStart { get; set; }
[Display(Name = "ChangeUpload")]
public Boolean? CgUpload { get; set; }
[Display(Name = "EnforcePeriodms")]
public UInt32? EnforcePeriod { get; set; }
[Display(Name = "CmdPeriodms")]
public UInt32? CmdPeriod { get; set; }
protected override void InitVM()
{
}
}
}

View File

@ -1,50 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiTemplateVM : BaseTemplateVM
{
[Display(Name = "DeviceName")]
public ExcelPropety DeviceName_Excel = ExcelPropety.CreateProperty<Device>(x => x.DeviceName);
[Display(Name = "Sort")]
public ExcelPropety Index_Excel = ExcelPropety.CreateProperty<Device>(x => x.Index);
[Display(Name = "Description")]
public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<Device>(x => x.Description);
public ExcelPropety Driver_Excel = ExcelPropety.CreateProperty<Device>(x => x.DriverId);
[Display(Name = "AutoStart")]
public ExcelPropety AutoStart_Excel = ExcelPropety.CreateProperty<Device>(x => x.AutoStart);
[Display(Name = "ChangeUpload")]
public ExcelPropety CgUpload_Excel = ExcelPropety.CreateProperty<Device>(x => x.CgUpload);
[Display(Name = "EnforcePeriodms")]
public ExcelPropety EnforcePeriod_Excel = ExcelPropety.CreateProperty<Device>(x => x.EnforcePeriod);
[Display(Name = "CmdPeriodms")]
public ExcelPropety CmdPeriod_Excel = ExcelPropety.CreateProperty<Device>(x => x.CmdPeriod);
[Display(Name = "Type")]
public ExcelPropety DeviceTypeEnum_Excel = ExcelPropety.CreateProperty<Device>(x => x.DeviceTypeEnum);
[Display(Name = "_Admin.Parent")]
public ExcelPropety Parent_Excel = ExcelPropety.CreateProperty<Device>(x => x.ParentId);
protected override void InitVM()
{
Driver_Excel.DataType = ColumnDataType.ComboBox;
Driver_Excel.ListItems = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
Parent_Excel.DataType = ColumnDataType.ComboBox;
Parent_Excel.ListItems = DC.Set<Device>().GetSelectListItems(Wtm, y => y.DeviceName);
}
}
public class DeviceApiImportVM : BaseImportVM<DeviceApiTemplateVM, Device>
{
}
}

View File

@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiListVM : BasePagedListVM<DeviceApi_View, DeviceApiSearcher>
{
protected override IEnumerable<IGridColumn<DeviceApi_View>> InitGridHeader()
{
return new List<GridColumn<DeviceApi_View>>{
this.MakeGridHeader(x => x.DeviceName),
this.MakeGridHeader(x => x.Index),
this.MakeGridHeader(x => x.Description),
this.MakeGridHeader(x => x.DriverName_view),
this.MakeGridHeader(x => x.AutoStart),
this.MakeGridHeader(x => x.CgUpload),
this.MakeGridHeader(x => x.EnforcePeriod),
this.MakeGridHeader(x => x.CmdPeriod),
this.MakeGridHeader(x => x.DeviceTypeEnum),
this.MakeGridHeader(x => x.DeviceName_view),
this.MakeGridHeaderAction(width: 200)
};
}
public override IOrderedQueryable<DeviceApi_View> GetSearchQuery()
{
var query = DC.Set<Device>()
.CheckContain(Searcher.DeviceName, x=>x.DeviceName)
.CheckEqual(Searcher.DriverId, x=>x.DriverId)
.Select(x => new DeviceApi_View
{
ID = x.ID,
DeviceName = x.DeviceName,
Index = x.Index,
Description = x.Description,
DriverName_view = x.Driver.DriverName,
AutoStart = x.AutoStart,
CgUpload = x.CgUpload,
EnforcePeriod = x.EnforcePeriod,
CmdPeriod = x.CmdPeriod,
DeviceTypeEnum = x.DeviceTypeEnum,
DeviceName_view = x.Parent.DeviceName,
})
.OrderBy(x => x.ID);
return query;
}
}
public class DeviceApi_View : Device{
[Display(Name = "DriverName")]
public String DriverName_view { get; set; }
[Display(Name = "DeviceName")]
public String DeviceName_view { get; set; }
}
}

View File

@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiSearcher : BaseSearcher
{
[Display(Name = "DeviceName")]
public String DeviceName { get; set; }
public Guid? DriverId { get; set; }
protected override void InitVM()
{
}
}
}

View File

@ -1,41 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceApiVM : BaseCRUDVM<Device>
{
public DeviceApiVM()
{
SetInclude(x => x.Driver);
SetInclude(x => x.Parent);
}
protected override void InitVM()
{
}
public override void DoAdd()
{
base.DoAdd();
}
public override void DoEdit(bool updateAllFields = false)
{
base.DoEdit(updateAllFields);
}
public override void DoDelete()
{
base.DoDelete();
}
}
}

View File

@ -18,10 +18,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
return new List<GridAction>
{
this.MakeAction("Device","Copy",Localizer["CopyDevice"],Localizer["CopyDevice"], GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-template-1").SetPromptMessage("你确定复制设备,包括配置参数和变量?").SetDialogTitle(Localizer["CopyDevice"]).SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("copy"),
this.MakeAction("Device","Attribute",Localizer["RequestAttribute"],Localizer["RequestAttribute"], GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-download-circle").SetPromptMessage("你确定请求客户端属性和共享属性吗?").SetDialogTitle(Localizer["RequestAttribute"]).SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("attribute"),
this.MakeAction("Device","CreateGroup",Localizer["CreateGroup"],Localizer["CreateGroup"], GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("_wtmicon _wtmicon-zuzhiqunzu").SetDialogTitle(Localizer["CreateGroup"]).SetShowInRow(false),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Create, Localizer["CreateDevice"],"BasicData", dialogWidth: 800,name:Localizer["CreateDevice"]).SetIconCls("layui-icon layui-icon-senior"),
this.MakeAction("Device","Copy","设备复制","设备复制", GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-template-1").SetPromptMessage("你确定复制设备,包括配置参数和变量?").SetDialogTitle("复制设备确认").SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("copy"),
this.MakeAction("Device","Attribute","请求属性","请求属性", GridActionParameterTypesEnum.SingleId,"BasicData",600).SetIconCls("layui-icon layui-icon-download-circle").SetPromptMessage("你确定请求客户端属性和共享属性吗?").SetDialogTitle("请求属性确认").SetHideOnToolBar(true).SetShowInRow(true).SetBindVisiableColName("attribute"),
this.MakeAction("Device","CreateGroup","创建组","创建组", GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("_wtmicon _wtmicon-zuzhiqunzu").SetDialogTitle("创建组").SetShowInRow(false),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Create, "创建设备","BasicData", dialogWidth: 800,name:"创建设备").SetIconCls("layui-icon layui-icon-senior"),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "BasicData", dialogWidth: 800),
@ -29,7 +29,6 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
this.MakeStandardAction("Device", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "BasicData", dialogWidth: 800),
//this.MakeStandardAction("Device", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("Device", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "BasicData"),
this.MakeAction("Device","ImportExcel",Localizer["ImportExcel"],Localizer["ImportExcel"], GridActionParameterTypesEnum.NoId,"BasicData",600).SetIconCls("layui-icon layui-icon-upload-circle").SetDialogTitle(Localizer["ImportExcel"]).SetHideOnToolBar(false).SetShowInRow(false),
};
}
@ -37,15 +36,15 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
protected override IEnumerable<IGridColumn<Device_View>> InitGridHeader()
{
return new List<GridColumn<Device_View>>{
this.MakeGridHeader(x => x.DeviceName).SetWidth(150),
this.MakeGridHeader(x => x.Index).SetWidth(60),
this.MakeGridHeader(x => x.DeviceName),
this.MakeGridHeader(x => x.Index),
//this.MakeGridHeader(x => x.Description),
this.MakeGridHeader(x => x.DriverName_view).SetWidth(150),
this.MakeGridHeader(x => x.AutoStart).SetWidth(80),
this.MakeGridHeader(x => x.CgUpload).SetWidth(100),
this.MakeGridHeader(x => x.EnforcePeriod).SetWidth(110),
this.MakeGridHeader(x => x.CmdPeriod).SetWidth(110),
this.MakeGridHeader(x => x.DeviceTypeEnum).SetWidth(80),
this.MakeGridHeader(x => x.DriverName_view),
this.MakeGridHeader(x => x.AutoStart),
this.MakeGridHeader(x => x.CgUpload),
this.MakeGridHeader(x => x.EnforcePeriod),
this.MakeGridHeader(x => x.CmdPeriod),
this.MakeGridHeader(x => x.DeviceTypeEnum),
//this.MakeGridHeader(x => x.DeviceName_view),
this.MakeGridHeader(x=>"copy").SetHide().SetFormat((a,b)=>{
if(a.DeviceTypeEnum== DeviceTypeEnum.Device)
@ -103,7 +102,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
AutoStart = y.AutoStart,
CgUpload = y.CgUpload,
EnforcePeriod = y.EnforcePeriod,
CmdPeriod = y.CmdPeriod,
CmdPeriod=y.CmdPeriod,
Description = y.Description,
DeviceTypeEnum = y.DeviceTypeEnum,
DriverName_view = y.Driver?.DriverName,
@ -122,9 +121,9 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
public class Device_View : Device
{
[Display(Name = "DriverName")]
[Display(Name = "驱动名")]
public String DriverName_view { get; set; }
[Display(Name = "GroupName")]
[Display(Name = "父级名")]
public String DeviceName_view { get; set; }
public int ExtraOrder { get; set; }
}

View File

@ -22,8 +22,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
protected override void InitVM()
{
AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.FileName);
AllParents = DC.Set<Device>().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Group).GetSelectListItems(Wtm, y => y.DeviceName);
AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
AllParents = DC.Set<Device>().Where(x=>x.DeviceTypeEnum== DeviceTypeEnum.Group).GetSelectListItems(Wtm, y => y.DeviceName);
}
public override void DoAdd()
@ -36,11 +36,11 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
deviceService.DrvierManager.AddConfigs(this.Entity.ID, this.Entity.DriverId);
var device = DC.Set<Device>().Where(x => x.ID == Entity.ID).Include(x => x.Parent).Include(x => x.Driver).Include(x => x.DeviceVariables).SingleOrDefault();
var device = DC.Set<Device>().Where(x => x.ID == Entity.ID).Include(x=>x.Parent).Include(x => x.Driver).SingleOrDefault();
deviceService.CreateDeviceThread(device);
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.DeviceAdded(device);
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.DeviceAdded(device);
}
}
catch (Exception ex)
@ -62,8 +62,8 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
List<Guid> Ids = new List<Guid>() { Guid.Parse(FC["id"].ToString()) };
var pluginManager = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.DeviceDeleted(Entity);
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.DeviceDeleted(Entity);
var ret = DeleteDevices.doDelete(pluginManager, DC, Ids);
if (!ret.IsSuccess)
{

View File

@ -8,7 +8,6 @@ using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using PluginInterface;
using Plugin;
using Microsoft.Extensions.Primitives;
namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
@ -22,15 +21,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public override bool DoBatchDelete()
{
//先获取id
var id = UpdateDevices.FC2Guids(FC);
var deviceId = DC.Set<DeviceVariable>().Where(x => id.Contains(x.ID)).Select(x => x.DeviceId).FirstOrDefault();
FC["Entity.DeviceId"] = (StringValues)deviceId.ToString();
var ret = base.DoBatchDelete();
if (ret)
{
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
UpdateDevices.UpdateVaribale(DC, deviceService, FC);
}
return ret;
@ -59,14 +53,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public String DeviceAddress { get; set; }
[Display(Name = "数据类型")]
public DataTypeEnum? DataType { get; set; }
[Display(Name = "大小端")]
public EndianEnum? EndianType { get; set; }
[Display(Name = "表达式")]
public string Expressions { get; set; }
public string Expression { get; set; }
[Display(Name = "权限")]
public ProtectTypeEnum? ProtectType { get; set; }
[Display(Name = "设备别名")]
public String Alias { get; set; }
protected override void InitVM()
{

View File

@ -6,8 +6,6 @@ using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using Microsoft.Extensions.Primitives;
using Plugin;
using PluginInterface;
@ -27,19 +25,11 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public ExcelPropety DeviceAddress_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.DeviceAddress);
[Display(Name = "数据类型")]
public ExcelPropety DataType_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.DataType);
[Display(Name = "触发")]
public ExcelPropety IsTrigger_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.IsTrigger);
[Display(Name = "大小端")]
public ExcelPropety EndianType_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.EndianType);
[Display(Name = "表达式")]
public ExcelPropety Expressions_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.Expressions);
[Display(Name = "上传")]
public ExcelPropety IsUpload_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.IsUpload);
[Display(Name = "权限")]
public ExcelPropety ProtectType_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.ProtectType);
public ExcelPropety Device_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.DeviceId);
[Display(Name = "设备别名")]
public ExcelPropety Alias_Excel = ExcelPropety.CreateProperty<DeviceVariable>(x => x.Alias);
protected override void InitVM()
{
@ -50,16 +40,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public class DeviceVariableImportVM : BaseImportVM<DeviceVariableTemplateVM, DeviceVariable>
{
public override bool BatchSaveData()
{
var result = base.BatchSaveData();
FC["Ids"] = new StringValues(EntityList.Select(x => x.DeviceId.ToString()).ToArray());
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
UpdateDevices.UpdateDevice(DC, deviceService, FC);
return result;
}
}
}

View File

@ -10,7 +10,6 @@ using IoTGateway.Model;
using PluginInterface;
using Plugin;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
@ -22,7 +21,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
return new List<GridAction>
{
this.MakeAction("DeviceVariable","SetValue",Localizer["WriteValue"],Localizer["WriteValue"], GridActionParameterTypesEnum.MultiIds,"BasicData",600).SetIconCls("_wtmicon _wtmicon-xiayibu").SetHideOnToolBar(false).SetShowInRow(false).SetBindVisiableColName("setValue"),
this.MakeAction("DeviceVariable","SetValue","写入值","写入值", GridActionParameterTypesEnum.MultiIds,"BasicData",600).SetIconCls("_wtmicon _wtmicon-xiayibu").SetHideOnToolBar(false).SetShowInRow(false).SetBindVisiableColName("setValue"),
this.MakeStandardAction("DeviceVariable", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceVariable", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "BasicData", dialogWidth: 800),
this.MakeStandardAction("DeviceVariable", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "BasicData", dialogWidth: 800),
@ -42,24 +41,20 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
.GetTreeSelectListItems(Wtm, x => x.DeviceName);
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
Parallel.ForEach(AllDevices, device =>
foreach (var device in AllDevices)
{
Parallel.ForEach(device.Children, item =>
foreach (var item in device.Children)
{
var deviceThread = deviceService.DeviceThreads.FirstOrDefault(x => x.Device.ID.ToString() == (string)item.Value);
var deviceThread = deviceService.DeviceThreads.Where(x => x.Device.ID.ToString() == (string)item.Value).FirstOrDefault();
if (deviceThread != null)
item.Icon = deviceThread.Device.AutoStart
? (deviceThread.Driver.IsConnected
? "layui-icon layui-icon-link"
: "layui-icon layui-icon-unlink")
: "layui-icon layui-icon-pause";
item.Icon = deviceThread.Device.AutoStart ? (deviceThread.Driver.IsConnected ? "layui-icon layui-icon-link" : "layui-icon layui-icon-unlink") : "layui-icon layui-icon-pause";
item.Text = " " + item.Text;
item.Expended = true;
item.Selected = item.Value.ToString() == IoTBackgroundService.VariableSelectDeviceId.ToString();
});
});
}
}
DevicesTree = GetLayuiTree(AllDevices);
base.InitListVM();
}
@ -68,31 +63,21 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
return new List<GridColumn<DeviceVariable_View>>{
this.MakeGridHeader(x => x.Name).SetSort(true).SetWidth(100),
//this.MakeGridHeader(x => x.Description),
this.MakeGridHeader(x => x.Method).SetSort(true).SetWidth(130),
this.MakeGridHeader(x => x.DeviceAddress).SetSort(true).SetWidth(100),
this.MakeGridHeader(x => x.DataType).SetSort(true).SetWidth(75),
this.MakeGridHeader(x => x.IsTrigger).SetWidth(90),
this.MakeGridHeader(x => x.EndianType).SetSort(true).SetWidth(90),
this.MakeGridHeader(x => x.Value).SetWidth(95).SetFormat((a,b)=>{
this.MakeGridHeader(x => x.Method).SetSort(true).SetWidth(160),
this.MakeGridHeader(x => x.DeviceAddress).SetSort(true).SetWidth(80),
this.MakeGridHeader(x => x.DataType).SetSort(true).SetWidth(80),
this.MakeGridHeader(x => x.Value).SetWidth(80).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_Value'>{a.Value}</div>";
}),
this.MakeGridHeader(x => x.CookedValue).SetWidth(95).SetFormat((a,b)=>{
this.MakeGridHeader(x => x.CookedValue).SetWidth(80).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_CookedValue'>{a.CookedValue}</div>";
}),
this.MakeGridHeader(x => x.StatusType).SetWidth(75).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_State'>{a.StatusType}</div>";
this.MakeGridHeader(x => x.State).SetWidth(80).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_State'>{a.State}</div>";
}),
this.MakeGridHeader(x => x.Expressions).SetWidth(150),
this.MakeGridHeader(x => x.IsUpload).SetWidth(80),
this.MakeGridHeader(x => x.ProtectType).SetWidth(80).SetSort(true),
//this.MakeGridHeader(x => x.ProtectType).SetSort(true),
this.MakeGridHeader(x => x.DeviceName_view).SetSort(true).SetWidth(90),
this.MakeGridHeader(x => x.Alias).SetSort(true).SetWidth(90),
this.MakeGridHeader(x => x.Timestamp).SetWidth(100).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_Timestamp'>{a.Timestamp:HH:mm:ss.fff}</div>";
}),
this.MakeGridHeader(x => x.Message).SetSort(true).SetWidth(200).SetFormat((a,b)=>{
return $"<div id='id{a.ID}_Message'>{a.Message}</div>";
}),
this.MakeGridHeader(x=> "detail").SetHide().SetFormat((a,b)=>{
return "false";
}),
@ -105,59 +90,28 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
};
}
public override void AfterDoSearcher()
{
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
foreach (var item in EntityList)
{
var DapThread = deviceService.DeviceThreads.Where(x => x.Device.ID == item.DeviceId).FirstOrDefault();
if (DapThread?.DeviceValues != null && DapThread.DeviceValues.ContainsKey(item.ID))
{
item.Value = DapThread?.DeviceValues[item.ID]?.Value?.ToString();
item.CookedValue = DapThread?.DeviceValues[item.ID]?.CookedValue?.ToString();
item.State = DapThread?.DeviceValues[item.ID]?.StatusType.ToString();
}
}
}
public override IOrderedQueryable<DeviceVariable_View> GetSearchQuery()
{
if (Searcher.DeviceId != null)
IoTBackgroundService.VariableSelectDeviceId = Searcher.DeviceId;
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
//设备线程中的所有设备
var threadDeviceIds = deviceService?.DeviceThreads.Select(x => x.Device.ID).Distinct(x => x);
//设备线程中的变量
var threadVariables =
deviceService?.DeviceThreads.Where(x => x.Device.DeviceVariables != null).SelectMany(deviceThread => deviceThread.Device.DeviceVariables);
//查找数据库中额外的变量
var dcVariables = DC.Set<DeviceVariable>().AsNoTracking().Include(x => x.Device)
.Where(x => !threadDeviceIds.Contains((Guid)x.DeviceId)).AsEnumerable();
var variables = dcVariables.Union(threadVariables).AsQueryable();
if (SearcherMode == ListVMSearchModeEnum.Batch)
{
var ids = UpdateDevices.FC2Guids(FC);
return variables.Where(x => ids.Contains(x.ID)).Select(x => new DeviceVariable_View
{
ID = x.ID,
DeviceId = x.DeviceId,
Name = x.Name,
Index = x.Index,
Description = x.Description,
Method = x.Method,
DeviceAddress = x.DeviceAddress,
DataType = x.DataType,
IsTrigger = x.IsTrigger,
EndianType = x.EndianType,
Expressions = x.Expressions,
IsUpload = x.IsUpload,
ProtectType = x.ProtectType,
DeviceName_view = x.Device.DeviceName,
Alias = x.Alias,
Device = x.Device,
Value = x.Value,
CookedValue = x.CookedValue,
StatusType = x.StatusType,
Timestamp = x.Timestamp,
Message = x.Message,
})
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName_view).ThenBy(x => x.Alias).ThenBy(x => x.Method)
.ThenBy(x => x.DeviceAddress);
}
return variables
var query = DC.Set<DeviceVariable>().Include(x => x.Device)
.CheckContain(Searcher.Name, x => x.Name)
.CheckContain(Searcher.Alias, x => x.Alias)
.CheckContain(Searcher.Method, x => x.Method)
.CheckContain(Searcher.DeviceAddress, x => x.DeviceAddress)
.CheckEqual(Searcher.DataType, x => x.DataType)
@ -172,27 +126,13 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
Method = x.Method,
DeviceAddress = x.DeviceAddress,
DataType = x.DataType,
IsTrigger = x.IsTrigger,
EndianType = x.EndianType,
Expressions = x.Expressions,
IsUpload = x.IsUpload,
ProtectType = x.ProtectType,
DeviceName_view = x.Device.DeviceName,
Alias = x.Alias,
Device = x.Device,
Value = x.Value,
CookedValue = x.CookedValue,
StatusType = x.StatusType,
Timestamp = x.Timestamp,
Message = x.Message,
Device = x.Device
})
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName_view).ThenBy(x => x.Alias).ThenBy(x => x.Method)
.ThenBy(x => x.DeviceAddress);
}
public override IOrderedQueryable<DeviceVariable_View> GetBatchQuery()
{
return GetSearchQuery();
.OrderBy(x => x.DeviceName_view).ThenBy(x => x.Index);
return query;
}
private List<LayuiTreeItem> GetLayuiTree(List<TreeSelectListItem> tree, int level = 0)
@ -253,7 +193,14 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public class DeviceVariable_View : DeviceVariable
{
[Display(Name = "DeviceName")]
public string DeviceName_view { get; set; }
[Display(Name = "设备名")]
public String DeviceName_view { get; set; }
[Display(Name = "原值")]
public String Value { get; set; }
[Display(Name = "值")]
public String CookedValue { get; set; }
[Display(Name = "状态")]
public String State { get; set; }
}
}

View File

@ -24,8 +24,6 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
public List<ComboSelectListItem> AllDevices { get; set; }
[Display(Name = "设备名")]
public Guid? DeviceId { get; set; }
[Display(Name = "设备别名")]
public String Alias { get; set; }
protected override void InitVM()
{

View File

@ -3,14 +3,12 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using IoTGateway.DataAccess.Migrations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using Plugin;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Primitives;
using PluginInterface;
namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
@ -26,11 +24,6 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
protected override void InitVM()
{
if (this.ControllerName.ToLower().Contains("add"))
{
this.Entity.IsUpload = true;
this.Entity.ProtectType = ProtectTypeEnum.ReadWrite;
}
AllDevices = DC.Set<Device>().AsNoTracking().Where(x => x.DeviceTypeEnum == DeviceTypeEnum.Device)
.OrderBy(x => x.Parent.Index).ThenBy(x => x.Parent.DeviceName)
.OrderBy(x => x.Index).ThenBy(x => x.DeviceName)
@ -81,7 +74,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
}
public override DuplicatedInfo<DeviceVariable> SetDuplicatedCheck()
{
var rv = CreateFieldsInfo(SimpleField(x => x.DeviceId), SimpleField(x => x.Name), SimpleField(x => x.Alias));
var rv = CreateFieldsInfo(SimpleField(x => x.DeviceId), SimpleField(x => x.Name));
return rv;
}
}

View File

@ -22,7 +22,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
{
try
{
StringValues ids, values;
StringValues ids , values;
if (FC.ContainsKey("setValue.ID[]"))
{
ids = (StringValues)FC["setValue.ID[]"];
@ -37,7 +37,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
Dictionary<string, string> kv = new(0);
for (int i = 0; i < ids.Count; i++)
{
kv[ids[i]] = values[i];
kv[ids[i]]=values[i];
}
@ -62,16 +62,12 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
string deviceName = dapThread.Device.DeviceName;
foreach (var variable in deviceVariables)
{
var currentVariable = dapThread!.Device.DeviceVariables.FirstOrDefault(x => x.ID == variable.ID);
if (currentVariable != null)
if (dapThread.DeviceValues.ContainsKey(variable.ID))
{
variable.DeviceName = deviceName + (!string.IsNullOrEmpty(variable.Alias)
? $"->{variable.Alias}"
: "");
variable.RawValue = currentVariable.Value?.ToString();
variable.Value = currentVariable.CookedValue?.ToString();
variable.Status = currentVariable.StatusType.ToString();
variable.DeviceName = deviceName;
variable.RawValue = dapThread.DeviceValues[variable.ID].Value?.ToString();
variable.Value = dapThread.DeviceValues[variable.ID].CookedValue?.ToString();
variable.Status = dapThread.DeviceValues[variable.ID].StatusType.ToString();
variable.SetRawValue = kv[variable.ID.ToString()];
}
}
@ -85,10 +81,10 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
};
dapThread.MyMqttClient_OnExcRpc(this, request);
}
}
}
= "下发完成请在Rpc日志页面查看结果";
= "设置成功";
}
catch (Exception ex)
{
@ -127,13 +123,12 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVariableVMs
string deviceName = dapThread.Device.DeviceName;
foreach (var variable in deviceVariables)
{
var currentVariable = dapThread!.Device.DeviceVariables.FirstOrDefault(x => x.ID == variable.ID);
if (currentVariable != null)
if (dapThread.DeviceValues.ContainsKey(variable.ID))
{
variable.DeviceName = deviceName;
variable.RawValue = currentVariable.Value?.ToString();
variable.Value = currentVariable.CookedValue?.ToString();
variable.Status = currentVariable.StatusType.ToString();
variable.RawValue = dapThread.DeviceValues[variable.ID].Value?.ToString();
variable.Value = dapThread.DeviceValues[variable.ID].CookedValue?.ToString();
variable.Status = dapThread.DeviceValues[variable.ID].StatusType.ToString();
}
}
}

View File

@ -52,7 +52,7 @@ namespace IoTGateway.ViewModel.BasicData.DriverVMs
AssembleName = x.AssembleName,
AuthorizesNum = x.AuthorizesNum,
})
.OrderBy(x => x.FileName);
.OrderBy(x => x.ID);
return query;
}

View File

@ -36,13 +36,6 @@ namespace IoTGateway.ViewModel.BasicData.DriverVMs
public override void DoEdit(bool updateAllFields = false)
{
var DriverService = Wtm.ServiceProvider.GetService(typeof(DriverService)) as DriverService;
Entity.AssembleName = DriverService.GetAssembleNameByFileName(Entity.FileName);
if (string.IsNullOrEmpty(Entity.AssembleName))
{
MSD.AddModelError("", "程序集获取失败");
return;
}
base.DoEdit(updateAllFields);
}

View File

@ -1,306 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using IoTGateway.Model;
using PluginInterface;
using Plugin;
using Newtonsoft.Json;
using IoTGateway.DataAccess.Migrations;
using NPOI.HSSF.Util;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using IoTGateway.ViewModel.BasicData.DeviceVariableVMs;
using IoTGateway.ViewModel.BasicData.DeviceConfigVMs;
using System.IO;
using System.Reflection;
using IoTGateway.ViewModel.Config.SystemConfigVMs;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
namespace IoTGateway.ViewModel.BasicData
{
public class ExportDevicesSetting : BaseVM
{
#region GetData
private List<Device> GetAllDevices()
{
var queryResult = DC.Set<Device>().AsNoTracking().AsNoTracking()
.Include(x => x.Parent).Include(x => x.Driver)
.OrderBy(x => x.ParentId).ToList();
return queryResult;
}
private List<DeviceConfig> GetAllDeviceConfigs()
{
var queryResult = DC.Set<DeviceConfig>().AsNoTracking().Include(x=>x.Device)
.OrderBy(x => x.Device.DeviceName).ThenBy(x => x.DeviceConfigName).ToList();
return queryResult;
}
private List<DeviceVariable> GetAllDeviceVariables()
{
var queryResult = DC.Set<DeviceVariable>().AsNoTracking().Include(x => x.Device)
.OrderBy(x => x.Device.DeviceName).ThenBy(x => x.Alias).ThenBy(x => x.Method).ThenBy(x => x.Index).ThenBy(x => x.DeviceAddress).ToList();
return queryResult;
}
private List<SystemConfig> GetAllSystemConfigs()
{
var queryResult = DC.Set<SystemConfig>().AsNoTracking()
.AsNoTracking()
.OrderBy(x => x.ID).ToList();
return queryResult;
}
#endregion
#region GenerateWorkSheet
private IWorkbook GenerateDevicesSheet(IWorkbook book, List<Device> devices)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("设备维护");
int currentRow = 0;
#region
string[] colName = { "名称", "排序", "驱动名", "启动", "变化上传", "归档周期ms", "指令间隔ms", "类型" ,"所属组"};
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var device in devices)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(device.DeviceName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.Index);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.Driver?.DriverName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.AutoStart);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.CgUpload);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.EnforcePeriod);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.CmdPeriod);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(device.DeviceTypeEnum));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(device.Parent?.DeviceName);
currentRow++;
}
#endregion
return book;
}
private IWorkbook GenerateDeviceConfigsSheet(IWorkbook book, List<DeviceConfig> deviceConfigs)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("通讯配置");
int currentRow = 0;
#region
string[] colName = { "设备名", "名称", "属性侧", "描述", "值", "备注" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var deviceConfig in deviceConfigs)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.Device?.DeviceName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.DeviceConfigName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(deviceConfig.DataSide));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.Description);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.Value);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceConfig.EnumInfo);
currentRow++;
}
#endregion
return book;
}
private IWorkbook GenerateDeviceVariablesSheet(IWorkbook book, List<DeviceVariable> deviceVariables)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("变量配置");
int currentRow = 0;
#region
string[] colName = { "设备名", "变量名", "方法", "地址", "类型", "大小端", "表达式", "别名","上传", "排序", "触发" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var deviceVariable in deviceVariables)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Device.DeviceName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Name);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Method);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.DeviceAddress);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(deviceVariable.DataType)); //deviceVariable.DataType.ToString();
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(deviceVariable.EndianType));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Expressions);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Alias);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.IsUpload);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.Index);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(deviceVariable.IsTrigger);
currentRow++;
}
#endregion
return book;
}
private IWorkbook GenerateSystemConfigSheet(IWorkbook book, List<SystemConfig> systemConfigs)
{
if (book == null)
{
book = new XSSFWorkbook();
}
ISheet sheet = book.CreateSheet("传输配置");
int currentRow = 0;
#region
string[] colName = { "网关名称", "ClientId", "输出平台", "Mqtt服务器", "Mqtt端口", "Mqtt用户名", "Mqtt密码" };
IRow row = sheet.CreateRow(currentRow);
row.HeightInPoints = 20;
for (int i = 0; i < colName.Length; i++)
{
row.CreateCell(i).SetCellValue(colName[i]);
}
currentRow++;
#endregion
#region
foreach (var systemConfig in systemConfigs)
{
int currentCol = 0;
IRow rowData = sheet.CreateRow(currentRow);
rowData.CreateCell(currentCol).SetCellValue(systemConfig.GatewayName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.ClientId);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(PropertyHelper.GetEnumDisplayName(systemConfig.IoTPlatformType));
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttIp);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttPort);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttUName);
currentCol++;
rowData.CreateCell(currentCol).SetCellValue(systemConfig.MqttUPwd);
currentRow++;
}
#endregion
return book;
}
#endregion
public byte[] Export()
{
byte[] result = null;
IWorkbook book = new XSSFWorkbook();
//Sheet1-设备维护
var allDevices = GetAllDevices();
book = GenerateDevicesSheet(book, allDevices);
//Sheet2-变量配置
var allDeviceVariables = GetAllDeviceVariables();
book = GenerateDeviceVariablesSheet(book, allDeviceVariables);
//Sheet3-通讯设置
var allDeviceConfigs = GetAllDeviceConfigs();
book = GenerateDeviceConfigsSheet(book, allDeviceConfigs);
//Sheet4-传输配置
var allSystemConfigs = GetAllSystemConfigs();
book = GenerateSystemConfigSheet(book, allSystemConfigs);
using MemoryStream ms = new MemoryStream();
book.Write(ms);
result = ms.ToArray();
return result;
}
}
}

View File

@ -1,282 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.DependencyInjection;
using WalkingTec.Mvvm.Core.Support.FileHandlers;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using PluginInterface;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
using Microsoft.Extensions.Logging;
namespace IoTGateway.ViewModel.BasicData
{
public class ImportExcelVM : BaseVM
{
[Display(Name = "全部覆盖")]
public bool Cover { get; set; }
public string { get; set; }
[Display(Name = "Excel模板文件")]
public Guid ExcelFileId { get; set; }
public FileAttachment ExcelFile { get; set; }
private List<Driver> _drivers;
private List<Device> _devices;
private List<DeviceVariable> _deviceVariables;
private Dictionary<string, DataTypeEnum> dateTypeNameMapping;
private Dictionary<string, EndianEnum> endianTypeNameMapping;
public void Import()
{
using var transaction = DC.BeginTransaction();
_drivers = DC.Set<Driver>().AsNoTracking().ToList();
var deviceService = Wtm.ServiceProvider.GetService(typeof(DeviceService)) as DeviceService;
try
{
var oldDevices = DC.Set<Device>().ToList();
if (true)//Cover
{
foreach (var device in oldDevices)
{
var dapConfigs = DC.Set<DeviceConfig>().Where(x => x.DeviceId == device.ID).ToList();
var dapVariables = DC.Set<DeviceVariable>().Where(x => x.DeviceId == device.ID).ToList();
var rpcs = DC.Set<RpcLog>().Where(x => x.DeviceId == device.ID).ToList();
//var dapGroups = DC.Set<VariableGroup>().Where(x => x.DeviceId == dap.ID).ToList();
DC.Set<DeviceConfig>().RemoveRange(dapConfigs);
DC.Set<DeviceVariable>().RemoveRange(dapVariables);
DC.Set<RpcLog>().RemoveRange(rpcs);
deviceService.RemoveDeviceThread(device);
}
DC.Set<Device>().RemoveRange(oldDevices);
DC.SaveChanges();
DeleteDevices.doDelete(deviceService, DC, oldDevices.Select(x => x.ID).ToList());
}
var fp = Wtm.ServiceProvider.GetRequiredService<WtmFileProvider>();
var file = fp.GetFile(ExcelFileId.ToString(), true, DC);
var xssfworkbook = new XSSFWorkbook(file.DataStream);
file.DataStream.Dispose();
//获取数据的Sheet页信息
var sheetDevice = xssfworkbook.GetSheet("设备维护");
var devices = GetDevices(sheetDevice);
DC.Set<Device>().AddRange(devices);
var sheetVariables = xssfworkbook.GetSheet("变量配置");
var deviceVariables = GetVariables(sheetVariables);
DC.Set<DeviceVariable>().AddRange(deviceVariables);
var sheetDeviceConfigs = xssfworkbook.GetSheet("通讯配置");
var deviceConfigs = GetDeviceConfigs(sheetDeviceConfigs);
DC.Set<DeviceConfig>().AddRange(deviceConfigs);
var sheetSystemConfig = xssfworkbook.GetSheet("传输配置");
var newSystemConfig = GetSystemConfig(sheetSystemConfig);
var systemConfig = DC.Set<SystemConfig>().First();
systemConfig.GatewayName = newSystemConfig.GatewayName;
systemConfig.ClientId = newSystemConfig.ClientId;
systemConfig.IoTPlatformType = newSystemConfig.IoTPlatformType;
systemConfig.MqttIp = newSystemConfig.MqttIp;
systemConfig.MqttPort = newSystemConfig.MqttPort;
systemConfig.MqttUName = newSystemConfig.MqttUName;
systemConfig.MqttUPwd = newSystemConfig.MqttUPwd;
DC.SaveChanges();
transaction.Commit();
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.StartClientAsync().Wait();
//重新启动采集
deviceService.CreateDeviceThreads();
=
$"成功导入{devices.Count(x => x.DeviceTypeEnum == DeviceTypeEnum.Device)}个设备,{devices.Count(x => x.DeviceTypeEnum == DeviceTypeEnum.Group)}个组";
}
catch (Exception ex)
{
transaction.Rollback();
= $"导入失败,已经回滚。{ex}";
Console.WriteLine($"{导入结果},{ex.Message}");
}
}
private List<Device> GetDevices(ISheet sheetDevice)
{
var devices = new List<Device>();
for (int i = 1; i <= sheetDevice.LastRowNum; i++)
{
try
{
var row = sheetDevice.GetRow(i);
Device device = new Device();
device.ID = Guid.NewGuid();
device.DeviceName = row.GetCell(0)?.ToString();
device.Index = uint.Parse(row.GetCell(1)?.ToString());
device.ParentId = devices.FirstOrDefault(x => x.DeviceName == row.GetCell(8)?.ToString() && x.DeviceTypeEnum == DeviceTypeEnum.Group)?.ID;
device.DeviceTypeEnum = device.ParentId == null ? DeviceTypeEnum.Group : DeviceTypeEnum.Device;
if (device.DeviceTypeEnum == DeviceTypeEnum.Device)
{
device.DriverId = _drivers.FirstOrDefault(x => x.DriverName == row.GetCell(2)?.ToString())?.ID;
device.AutoStart = row.GetCell(3).BooleanCellValue;
device.CgUpload = row.GetCell(4).BooleanCellValue;
device.EnforcePeriod = uint.Parse(row.GetCell(5)?.ToString());
device.CmdPeriod = uint.Parse(row.GetCell(6)?.ToString());
}
devices.Add(device);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
_devices = devices;
return devices;
}
private List<DeviceVariable> GetVariables(ISheet sheet)
{
DateTypeNameMapping();
EndianNameMapping();
var deviceVariables = new List<DeviceVariable>();
for (int i = 1; i <= sheet.LastRowNum; i++)
{
try
{
var row = sheet.GetRow(i);
var variable = new DeviceVariable();
variable.ID = Guid.NewGuid();
variable.DeviceId = _devices.FirstOrDefault(x => x.DeviceName == row.GetCell(0)?.ToString())?.ID;
variable.Name = row.GetCell(1)?.ToString();
variable.Method = row.GetCell(2)?.ToString();
variable.DeviceAddress = row.GetCell(3)?.ToString();
variable.DataType = dateTypeNameMapping.ContainsKey(row.GetCell(4)?.ToString()) ? dateTypeNameMapping[row.GetCell(4)?.ToString()] : DataTypeEnum.Any;
variable.EndianType = endianTypeNameMapping.ContainsKey(row.GetCell(5)?.ToString()) ? endianTypeNameMapping[row.GetCell(5)?.ToString()] : EndianEnum.None;
variable.Expressions = row.GetCell(6)?.ToString();
variable.Alias = row.GetCell(7)?.ToString();
variable.IsUpload = row.GetCell(8)?.ToString().ToLower() == "false" ? false : true;
variable.Index = string.IsNullOrWhiteSpace(row.GetCell(9)?.ToString())
? 999
: uint.Parse(row.GetCell(9).ToString());
variable.IsTrigger = row.GetCell(10)?.ToString().ToLower() == "false" ? false : true;
deviceVariables.Add(variable);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
_deviceVariables = deviceVariables;
return deviceVariables;
}
private List<DeviceConfig> GetDeviceConfigs(ISheet sheet)
{
var deviceConfigs = new List<DeviceConfig>();
for (int i = 1; i <= sheet.LastRowNum; i++)
{
try
{
var row = sheet.GetRow(i);
var config = new DeviceConfig();
config.ID = Guid.NewGuid();
config.DeviceId = _devices.FirstOrDefault(x => x.DeviceName == row.GetCell(0)?.ToString())?.ID;
config.DeviceConfigName = row.GetCell(1)?.ToString();
config.DataSide = row.GetCell(2)?.ToString() == "共享属性" ? DataSide.AnySide : DataSide.ClientSide;
config.Description = row.GetCell(3)?.ToString();
config.Value = row.GetCell(4)?.ToString();
config.EnumInfo = row.GetCell(5)?.ToString();
deviceConfigs.Add(config);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
return deviceConfigs;
}
private SystemConfig GetSystemConfig(ISheet sheet)
{
var systemConfig = new SystemConfig();
for (int i = 1; i <= 1; i++)
{
try
{
var row = sheet.GetRow(i);
systemConfig.GatewayName = row.GetCell(0)?.ToString();
systemConfig.ClientId = row.GetCell(1)?.ToString();
systemConfig.IoTPlatformType = IoTPlatformType.IoTSharp;
systemConfig.MqttIp = row.GetCell(3)?.ToString();
systemConfig.MqttPort = int.Parse(row.GetCell(4)?.ToString());
systemConfig.MqttUName = row.GetCell(5)?.ToString();
systemConfig.MqttUPwd = row.GetCell(6)?.ToString();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
return systemConfig;
}
protected void DateTypeNameMapping()
{
dateTypeNameMapping = new Dictionary<string, DataTypeEnum>();
var enumType = typeof(DataTypeEnum);
var displayAttributeType = typeof(DisplayAttribute);
DataTypeEnum? found = null;
foreach (var name in Enum.GetNames(enumType))
{
var member = enumType.GetMember(name).First();
var displayAttrib = (DisplayAttribute)member.GetCustomAttributes(displayAttributeType, false).First();
dateTypeNameMapping.Add(displayAttrib.Name, (DataTypeEnum)Enum.Parse(enumType, name));
}
}
protected void EndianNameMapping()
{
endianTypeNameMapping = new Dictionary<string, EndianEnum>();
var enumType = typeof(EndianEnum);
var displayAttributeType = typeof(DisplayAttribute);
EndianEnum? found = null;
Enum.GetNames(enumType).ToList().ForEach(name =>
{
var member = enumType.GetMember(name).First();
var displayAttrib = (DisplayAttribute)member.GetCustomAttributes(displayAttributeType, false).First();
endianTypeNameMapping.Add(displayAttrib.Name, (EndianEnum)Enum.Parse(enumType, name));
});
}
}
}

View File

@ -29,8 +29,8 @@ namespace IoTGateway.ViewModel.Config.SystemConfigVMs
public override void DoEdit(bool updateAllFields = false)
{
base.DoEdit(updateAllFields);
var messageService = Wtm.ServiceProvider.GetService(typeof(MessageService)) as MessageService;
messageService.StartClientAsync().Wait();
var myMqttClient = Wtm.ServiceProvider.GetService(typeof(MyMqttClient)) as MyMqttClient;
myMqttClient.StartClientAsync().Wait();
}
public override void DoDelete()

View File

@ -67,34 +67,34 @@ namespace IoTGateway.ViewModel.MqttClient.MqttServerVMs
}
public class MqttClient_View : TopBasePoco
{
[Display(Name = "ClientId")]
[Display(Name = "客户端Id")]
public string ClientId { get; set; }
[Display(Name = "Endpoint")]
public string Endpoint { get; set; }
[Display(Name = "RxMessages")]
[Display(Name = "收消息数")]
public long ReceivedApplicationMessagesCount { get; set; }
[Display(Name = "TxMessages")]
[Display(Name = "收发消息数")]
public long SentApplicationMessagesCount { get; set; }
[Display(Name = "RxPackets")]
[Display(Name = "收包数")]
public long ReceivedPacketsCount { get; set; }
[Display(Name = "TxPackets")]
[Display(Name = "发包数")]
public long SentPacketsCount { get; set; }
[Display(Name = "TxBytes")]
[Display(Name = "发字节数")]
public long BytesSent { get; set; }
[Display(Name = "RxBytes")]
[Display(Name = "收字节数")]
public long BytesReceived { get; set; }
[Display(Name = "PendingMessage")]
[Display(Name = "未决消息数")]
public long PendingApplicationMessagesCount { get; set; }
[Display(Name = "ProtocolVersion")]
[Display(Name = "协议版本")]
public MqttProtocolVersion MqttProtocolVersion { get; set; }
}

View File

@ -38,7 +38,7 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs
this.MakeGridHeader(x => x.DeviceName_view),
this.MakeGridHeader(x => x.Method),
this.MakeGridHeader(x => x.Params),
this.MakeGridHeader(x => x.IsSuccess),
this.MakeGridHeader(x => x.IsSuccess).SetHeader("是否成功"),
this.MakeGridHeader(x => x.Description),
this.MakeGridHeaderAction(width: 200)
};
@ -92,9 +92,9 @@ namespace IoTGateway.ViewModel.Rpc.RpcLogVMs
public class RpcLog_View : RpcLog
{
[Display(Name = "DeviceName")]
[Display(Name = "设备名")]
public String DeviceName_view { get; set; }
[Display(Name = "Duration(ms)")]
[Display(Name = "持续时间(ms)")]
public double Duration { get; set; }
}

View File

@ -27,45 +27,27 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PluginInterface", "Plugins\
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Drivers", "Drivers", "{D05CFF72-D58C-418A-8F52-B06848DAC4F1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.ModBusMaster", "Plugins\Drivers\PLC.ModBusMaster\PLC.ModBusMaster.csproj", "{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverAllenBradley", "Plugins\Drivers\DriverAllenBradley\DriverAllenBradley.csproj", "{3106F31C-0502-42D3-A27B-BDD2199D72CC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CNC.Fanuc", "Plugins\Drivers\CNC.Fanuc\CNC.Fanuc.csproj", "{C7C873AE-1346-454F-B37C-F278524452EA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverMitsubishi", "Plugins\Drivers\DriverMitsubishi\DriverMitsubishi.csproj", "{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.AllenBradley", "Plugins\Drivers\PLC.AllenBradley\PLC.AllenBradley.csproj", "{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverModbusMaster", "Plugins\Drivers\DriverModbusMaster\DriverModbusMaster.csproj", "{8E2D91DC-DEE4-4843-8D09-6FC06651527E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PLC", "PLC", "{1606D516-3865-4F57-9199-93091CF546F5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverMTConnect", "Plugins\Drivers\DriverMTConnect\DriverMTConnect.csproj", "{64D4C755-33DD-4103-908B-82FA63C5BFB2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Building", "Building", "{FFE700D9-F02F-4973-9D9E-0B370D00D5C1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverOPCUaClient", "Plugins\Drivers\DriverOPCUaClient\DriverOPCUaClient.csproj", "{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CNC", "CNC", "{789C3203-3CE0-466C-A4F0-4B405406B94A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverSiemensS7", "Plugins\Drivers\DriverSiemensS7\DriverSiemensS7.csproj", "{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Energy", "Energy", "{49BBB20D-6453-40C2-A9C7-F77DBCB95974}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverOmronFins", "Plugins\Drivers\DriverOmronFins\DriverOmronFins.csproj", "{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other", "Other", "{912978D3-65E6-4029-ABEF-9673F3225605}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverSimTcpClient", "Plugins\Drivers\DriverSimTcpClient\DriverSimTcpClient.csproj", "{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Other.Toledo", "Plugins\Drivers\Other.Toledo\Other.Toledo.csproj", "{22938881-111F-438C-8FE2-2053BD2C97AA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverFanucHsl", "Plugins\Drivers\DriverFanucHsl\DriverFanucHsl.csproj", "{10D22B6E-DE30-4F11-A005-8188DF549F72}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CNC.Fanuc.H", "Plugins\Drivers\CNC.Fanuc.H\CNC.Fanuc.H.csproj", "{FBB004B6-2422-472B-AE5F-46CBE841EFF8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DriverFanuc", "Plugins\Drivers\DriverFanuc\DriverFanuc.csproj", "{41F81606-1728-4A03-AE64-FA2CCF49BE5A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.MelsecMc", "Plugins\Drivers\PLC.MelsecMc\PLC.MelsecMc.csproj", "{35074354-AF67-468D-A0F3-4DA9000912D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.SiemensS7", "Plugins\Drivers\PLC.SiemensS7\PLC.SiemensS7.csproj", "{DACBF090-B59F-4962-9B93-B00F9E031F57}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CNC.MTConnect", "Plugins\Drivers\CNC.MTConnect\CNC.MTConnect.csproj", "{4CE60A0C-0B7D-49D6-880E-D28782693586}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PLC.OmronFins", "Plugins\Drivers\PLC.OmronFins\PLC.OmronFins.csproj", "{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OPC", "OPC", "{F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OPC.DaClient", "Plugins\Drivers\OPC.DaClient\OPC.DaClient.csproj", "{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OPC.UaClient", "Plugins\Drivers\OPC.UaClient\OPC.UaClient.csproj", "{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mock", "Mock", "{87954B15-5C35-4454-AFC7-9DCE8066D5A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mock.TcpClient", "Plugins\Drivers\Mock.TcpClient\Mock.TcpClient.csproj", "{1DE34C11-5461-442B-8C67-FCB0247C09D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PLC.LSIS", "Plugins\Drivers\PLC.LS\PLC.LSIS.csproj", "{D3043673-283C-45D7-8F86-6BAAD89AF761}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DriverOPCDaClient", "Plugins\Drivers\DriverOPCDaClient\DriverOPCDaClient.csproj", "{00FDB860-1A25-40D0-B29E-BAF2253713D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -147,110 +129,94 @@ Global
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954}.Release|Any CPU.Build.0 = Release|Any CPU
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954}.Release|x86.ActiveCfg = Release|Any CPU
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954}.Release|x86.Build.0 = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|x86.ActiveCfg = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Debug|x86.Build.0 = Debug|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|Any CPU.Build.0 = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|x86.ActiveCfg = Release|Any CPU
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9}.Release|x86.Build.0 = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|x86.ActiveCfg = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Debug|x86.Build.0 = Debug|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|Any CPU.Build.0 = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|x86.ActiveCfg = Release|Any CPU
{C7C873AE-1346-454F-B37C-F278524452EA}.Release|x86.Build.0 = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|x86.ActiveCfg = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Debug|x86.Build.0 = Debug|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|Any CPU.Build.0 = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|x86.ActiveCfg = Release|Any CPU
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7}.Release|x86.Build.0 = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|x86.ActiveCfg = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Debug|x86.Build.0 = Debug|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|Any CPU.Build.0 = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|x86.ActiveCfg = Release|Any CPU
{22938881-111F-438C-8FE2-2053BD2C97AA}.Release|x86.Build.0 = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|x86.ActiveCfg = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Debug|x86.Build.0 = Debug|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|Any CPU.Build.0 = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|x86.ActiveCfg = Release|Any CPU
{FBB004B6-2422-472B-AE5F-46CBE841EFF8}.Release|x86.Build.0 = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Debug|x86.Build.0 = Debug|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|Any CPU.Build.0 = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|x86.ActiveCfg = Release|Any CPU
{35074354-AF67-468D-A0F3-4DA9000912D3}.Release|x86.Build.0 = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|x86.ActiveCfg = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Debug|x86.Build.0 = Debug|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|Any CPU.Build.0 = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|x86.ActiveCfg = Release|Any CPU
{DACBF090-B59F-4962-9B93-B00F9E031F57}.Release|x86.Build.0 = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|x86.ActiveCfg = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Debug|x86.Build.0 = Debug|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|Any CPU.Build.0 = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|x86.ActiveCfg = Release|Any CPU
{4CE60A0C-0B7D-49D6-880E-D28782693586}.Release|x86.Build.0 = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|x86.ActiveCfg = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Debug|x86.Build.0 = Debug|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|Any CPU.Build.0 = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|x86.ActiveCfg = Release|Any CPU
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8}.Release|x86.Build.0 = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|x86.ActiveCfg = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Debug|x86.Build.0 = Debug|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|Any CPU.Build.0 = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|x86.ActiveCfg = Release|Any CPU
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4}.Release|x86.Build.0 = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|x86.ActiveCfg = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Debug|x86.Build.0 = Debug|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|Any CPU.Build.0 = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|x86.ActiveCfg = Release|Any CPU
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831}.Release|x86.Build.0 = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Debug|x86.Build.0 = Debug|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|Any CPU.Build.0 = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|x86.ActiveCfg = Release|Any CPU
{1DE34C11-5461-442B-8C67-FCB0247C09D3}.Release|x86.Build.0 = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|x86.ActiveCfg = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Debug|x86.Build.0 = Debug|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|Any CPU.Build.0 = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|x86.ActiveCfg = Release|Any CPU
{D3043673-283C-45D7-8F86-6BAAD89AF761}.Release|x86.Build.0 = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|x86.ActiveCfg = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Debug|x86.Build.0 = Debug|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|Any CPU.Build.0 = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|x86.ActiveCfg = Release|Any CPU
{3106F31C-0502-42D3-A27B-BDD2199D72CC}.Release|x86.Build.0 = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|x86.ActiveCfg = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Debug|x86.Build.0 = Debug|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|Any CPU.Build.0 = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|x86.ActiveCfg = Release|Any CPU
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357}.Release|x86.Build.0 = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|x86.ActiveCfg = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Debug|x86.Build.0 = Debug|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|Any CPU.Build.0 = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|x86.ActiveCfg = Release|Any CPU
{8E2D91DC-DEE4-4843-8D09-6FC06651527E}.Release|x86.Build.0 = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|x86.ActiveCfg = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Debug|x86.Build.0 = Debug|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|Any CPU.Build.0 = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|x86.ActiveCfg = Release|Any CPU
{64D4C755-33DD-4103-908B-82FA63C5BFB2}.Release|x86.Build.0 = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|x86.ActiveCfg = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Debug|x86.Build.0 = Debug|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|Any CPU.Build.0 = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|x86.ActiveCfg = Release|Any CPU
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6}.Release|x86.Build.0 = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|x86.ActiveCfg = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Debug|x86.Build.0 = Debug|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|Any CPU.Build.0 = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|x86.ActiveCfg = Release|Any CPU
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2}.Release|x86.Build.0 = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Debug|x86.Build.0 = Debug|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|Any CPU.Build.0 = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|x86.ActiveCfg = Release|Any CPU
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1}.Release|x86.Build.0 = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|x86.ActiveCfg = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Debug|x86.Build.0 = Debug|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|Any CPU.Build.0 = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|x86.ActiveCfg = Release|Any CPU
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F}.Release|x86.Build.0 = Release|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|x86.ActiveCfg = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Debug|x86.Build.0 = Debug|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|Any CPU.Build.0 = Release|Any CPU
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|x86.ActiveCfg = Release|x86
{10D22B6E-DE30-4F11-A005-8188DF549F72}.Release|x86.Build.0 = Release|x86
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|x86.ActiveCfg = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Debug|x86.Build.0 = Debug|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|Any CPU.Build.0 = Release|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|x86.ActiveCfg = Release|Any CPU
{41F81606-1728-4A03-AE64-FA2CCF49BE5A}.Release|x86.Build.0 = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|x86.ActiveCfg = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Debug|x86.Build.0 = Debug|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|Any CPU.Build.0 = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|x86.ActiveCfg = Release|Any CPU
{00FDB860-1A25-40D0-B29E-BAF2253713D6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -262,26 +228,17 @@ Global
{5C12EBFB-B152-48C6-AA52-71128F246594} = {2C665127-D9D0-445E-80A9-FD459673D454}
{7752AD8C-04BF-4BD2-9272-CDA4F78FA954} = {2C665127-D9D0-445E-80A9-FD459673D454}
{D05CFF72-D58C-418A-8F52-B06848DAC4F1} = {2C665127-D9D0-445E-80A9-FD459673D454}
{B6D55C31-E1B9-4A59-9BD1-A531EC5306A9} = {1606D516-3865-4F57-9199-93091CF546F5}
{C7C873AE-1346-454F-B37C-F278524452EA} = {789C3203-3CE0-466C-A4F0-4B405406B94A}
{42E1D556-D4B4-4DE0-BFAC-EC18EFC85AE7} = {1606D516-3865-4F57-9199-93091CF546F5}
{1606D516-3865-4F57-9199-93091CF546F5} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{FFE700D9-F02F-4973-9D9E-0B370D00D5C1} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{789C3203-3CE0-466C-A4F0-4B405406B94A} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{49BBB20D-6453-40C2-A9C7-F77DBCB95974} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{912978D3-65E6-4029-ABEF-9673F3225605} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{22938881-111F-438C-8FE2-2053BD2C97AA} = {912978D3-65E6-4029-ABEF-9673F3225605}
{FBB004B6-2422-472B-AE5F-46CBE841EFF8} = {789C3203-3CE0-466C-A4F0-4B405406B94A}
{35074354-AF67-468D-A0F3-4DA9000912D3} = {1606D516-3865-4F57-9199-93091CF546F5}
{DACBF090-B59F-4962-9B93-B00F9E031F57} = {1606D516-3865-4F57-9199-93091CF546F5}
{4CE60A0C-0B7D-49D6-880E-D28782693586} = {789C3203-3CE0-466C-A4F0-4B405406B94A}
{F5CAB900-BB39-48F4-A1AF-AD84491BECF8} = {1606D516-3865-4F57-9199-93091CF546F5}
{F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{43732FDC-59DD-4D16-9BF0-B9CD431CA8A4} = {F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F}
{0C82F208-B9B3-485D-A6DD-9ADC59FBF831} = {F8957F78-9D5D-4905-9EFC-EEEBA3A3A13F}
{87954B15-5C35-4454-AFC7-9DCE8066D5A0} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{1DE34C11-5461-442B-8C67-FCB0247C09D3} = {87954B15-5C35-4454-AFC7-9DCE8066D5A0}
{D3043673-283C-45D7-8F86-6BAAD89AF761} = {1606D516-3865-4F57-9199-93091CF546F5}
{3106F31C-0502-42D3-A27B-BDD2199D72CC} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{8919CDA5-23A6-4C04-87F9-C83DF4BEF357} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{8E2D91DC-DEE4-4843-8D09-6FC06651527E} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{64D4C755-33DD-4103-908B-82FA63C5BFB2} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{AAC81E6C-C62E-4F52-85B5-1EA8D54AE9F6} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{28FEF3AF-4CAA-4B5C-B16F-E74BAD70BCE2} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{FE2BFDBD-E021-45EA-B327-C56F6114D7A1} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{F8EC5EDE-9A2C-443B-B125-E39C748EBB2F} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{10D22B6E-DE30-4F11-A005-8188DF549F72} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{41F81606-1728-4A03-AE64-FA2CCF49BE5A} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
{00FDB860-1A25-40D0-B29E-BAF2253713D6} = {D05CFF72-D58C-418A-8F52-B06848DAC4F1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1F219808-E6E8-4C1D-B846-41F2F7CF20FA}

View File

@ -1,41 +0,0 @@
using System.Linq;
using System.Threading.Tasks;
using IoTGateway.Model;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Plugin;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc;
namespace IoTGateway.Areas.API
{
/// <summary>
/// 设备和数据查询api
/// </summary>
[Area("API")]
[ActionDescription("MenuKey.ActionLog")]
public class DeviceController : BaseController
{
private readonly ILogger<DeviceController> _logger;
private readonly DeviceService _deviceService;
public DeviceController(ILogger<DeviceController> logger, DeviceService deviceService)
{
_logger = logger;
_deviceService = deviceService;
}
/// <summary>
/// 获取设备列表
/// </summary>
/// <returns></returns>
[Public]
[HttpGet("Device/GetDevices")]
public async Task<IActionResult> GetDevices()
{
return Ok(await DC.Set<Device>().Include(x => x.Driver).Where(x => x.ParentId != null).AsNoTracking()
.OrderBy(x => x.Index).ToListAsync());
}
}
}

View File

@ -1,180 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using WalkingTec.Mvvm.Mvc;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
using IoTGateway.Model;
namespace IoTGateway.Controllers
{
[Area("BasicData")]
[AuthorizeJwtWithCookie]
[ActionDescription("设备维护Api")]
[ApiController]
[Route("api/Device")]
public partial class DeviceApiController : BaseApiController
{
[ActionDescription("Sys.Search")]
[HttpPost("Search")]
public IActionResult Search(DeviceApiSearcher searcher)
{
if (ModelState.IsValid)
{
var vm = Wtm.CreateVM<DeviceApiListVM>(passInit: true);
vm.Searcher = searcher;
return Content(vm.GetJson());
}
else
{
return BadRequest(ModelState.GetErrorJson());
}
}
[ActionDescription("Sys.Get")]
[HttpGet("{id}")]
public DeviceApiVM Get(string id)
{
var vm = Wtm.CreateVM<DeviceApiVM>(id);
return vm;
}
[ActionDescription("Sys.Create")]
[HttpPost("Add")]
public IActionResult Add(DeviceApiVM vm)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
vm.DoAdd();
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
return Ok(vm.Entity);
}
}
}
[ActionDescription("Sys.Edit")]
[HttpPut("Edit")]
public IActionResult Edit(DeviceApiVM vm)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
vm.DoEdit(false);
if (!ModelState.IsValid)
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
return Ok(vm.Entity);
}
}
}
[HttpPost("BatchDelete")]
[ActionDescription("Sys.Delete")]
public IActionResult BatchDelete(string[] ids)
{
var vm = Wtm.CreateVM<DeviceApiBatchVM>();
if (ids != null && ids.Count() > 0)
{
vm.Ids = ids;
}
else
{
return Ok();
}
if (!ModelState.IsValid || !vm.DoBatchDelete())
{
return BadRequest(ModelState.GetErrorJson());
}
else
{
return Ok(ids.Count());
}
}
[ActionDescription("Sys.Export")]
[HttpPost("ExportExcel")]
public IActionResult ExportExcel(DeviceApiSearcher searcher)
{
var vm = Wtm.CreateVM<DeviceApiListVM>();
vm.Searcher = searcher;
vm.SearcherMode = ListVMSearchModeEnum.Export;
return vm.GetExportData();
}
[ActionDescription("Sys.CheckExport")]
[HttpPost("ExportExcelByIds")]
public IActionResult ExportExcelByIds(string[] ids)
{
var vm = Wtm.CreateVM<DeviceApiListVM>();
if (ids != null && ids.Count() > 0)
{
vm.Ids = new List<string>(ids);
vm.SearcherMode = ListVMSearchModeEnum.CheckExport;
}
return vm.GetExportData();
}
[ActionDescription("Sys.DownloadTemplate")]
[HttpGet("GetExcelTemplate")]
public IActionResult GetExcelTemplate()
{
var vm = Wtm.CreateVM<DeviceApiImportVM>();
var qs = new Dictionary<string, string>();
foreach (var item in Request.Query.Keys)
{
qs.Add(item, Request.Query[item]);
}
vm.SetParms(qs);
var data = vm.GenerateTemplate(out string fileName);
return File(data, "application/vnd.ms-excel", fileName);
}
[ActionDescription("Sys.Import")]
[HttpPost("Import")]
public ActionResult Import(DeviceApiImportVM vm)
{
if (vm!=null && (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData()))
{
return BadRequest(vm.GetErrorJson());
}
else
{
return Ok(vm?.EntityList?.Count ?? 0);
}
}
[HttpGet("GetDrivers")]
public ActionResult GetDrivers()
{
return Ok(DC.Set<Driver>().GetSelectListItems(Wtm, x => x.DriverName));
}
[HttpGet("GetDevices")]
public ActionResult GetDevices()
{
return Ok(DC.Set<Device>().GetSelectListItems(Wtm, x => x.DeviceName));
}
}
}

View File

@ -6,7 +6,6 @@ using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.ViewModel.BasicData.DeviceVMs;
using Plugin;
using IoTGateway.ViewModel.BasicData;
namespace IoTGateway.Controllers
{
@ -254,17 +253,7 @@ namespace IoTGateway.Controllers
[HttpPost]
public IActionResult ExportExcel(DeviceListVM vm)
{
ExportDevicesSetting myExporter = new ExportDevicesSetting();
myExporter.DC = vm.DC;
var data = myExporter.Export();
string ContentType = "application/vnd.ms-excel";
string exportName = $"iotgateway.net_bakup_{DateTime.Now.ToString("yyyyMMddHHmmssffff")}.xlsx";
FileContentResult Result = new FileContentResult(data, ContentType);
Result.FileDownloadName = exportName;
return Result;
//return vm.GetExportData();
return vm.GetExportData();
}
#region
@ -318,30 +307,5 @@ namespace IoTGateway.Controllers
{
return JsonMore(_DeviceService.GetDriverMethods(ID));
}
#region Excel
[ActionDescription("导入Excel")]
public ActionResult ImportExcel()
{
var vm = Wtm.CreateVM<ImportExcelVM>();
return PartialView(vm);
}
[HttpPost]
[ActionDescription("导入Excel")]
public ActionResult ImportExcel(ImportExcelVM vm)
{
if (!ModelState.IsValid)
{
return PartialView(vm);
}
else
{
vm.Import();
return FFResult().CloseDialog().RefreshGrid().Alert($"{vm.导入结果}");
}
}
#endregion
}
}

View File

@ -1,18 +0,0 @@
@model IoTGateway.ViewModel.BasicData.ImportExcelVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model" >
<wt:row items-per-row="ItemsPerRowEnum.One">
<wt:quote>导入会删除系统内所有设备</wt:quote>
</wt:row>
<wt:row items-per-row="ItemsPerRowEnum.Two">
@*<wt:switch field=Cover />*@
<wt:upload field="ExcelFileId" upload-type="ExcelFile"/>
</wt:row>
<wt:row align="AlignEnum.Right">
<wt:submitbutton text="导入" />
<wt:closebutton text="取消" />
</wt:row>
</wt:form>

View File

@ -3,7 +3,7 @@
<wt:form vm="@Model" height="400">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.DeviceConfigName" />
@*<wt:textbox field="Entity.DeviceConfigName" />*@
@{
if (!string.IsNullOrEmpty(Model.Entity.EnumInfo))
{
@ -15,7 +15,7 @@
}
}
<wt:textbox field="Entity.Description" />
<wt:combobox field="Entity.DataSide" />
@*<wt:textbox field="Entity.EnumInfo" />*@
@*<wt:combobox field="Entity.DeviceId" items="AllDevices" />*@
</wt:row>
<wt:hidden field="Entity.ID" />

View File

@ -3,17 +3,15 @@
<wt:form vm="@Model">
<div style="margin-bottom:10px">@Localizer["Sys.BatchEditConfirm"] </div>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="LinkedVM.Name" />
<wt:textbox field="LinkedVM.DeviceAddress" />
<wt:combobox field="LinkedVM.DataType" />
<wt:combobox field="LinkedVM.EndianType" />
<wt:textbox field="LinkedVM.Expressions" />
<wt:combobox field="LinkedVM.ProtectType" />
<wt:textbox field="LinkedVM.Alias" />
</wt:row>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="LinkedVM.Name" />
<wt:textbox field="LinkedVM.DeviceAddress" />
<wt:combobox field="LinkedVM.DataType" />
<wt:textbox field="LinkedVM.Expression" />
<wt:combobox field="LinkedVM.ProtectType" />
</wt:row>
<wt:hidden field="Ids" />
<wt:grid vm="ListVM" use-local-data="true" height="300" hidden-checkbox="true" hidden-panel="true" />
<wt:grid vm="ListVM" use-local-data="true" height="300" hidden-checkbox="true" hidden-panel="true"/>
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />

View File

@ -10,12 +10,8 @@
<wt:combobox field="Entity.Method" items="AllMethods" required="true" />
<wt:textbox field="Entity.DeviceAddress" />
<wt:combobox field="Entity.DataType" />
<wt:switch field="Entity.IsTrigger" />
<wt:combobox field="Entity.EndianType" />
<wt:textbox field="Entity.Expressions" />
<wt:switch field="Entity.IsUpload" />
<wt:textbox field="Entity.Expressions"/>
<wt:combobox field="Entity.ProtectType" />
<wt:textbox field="Entity.Alias" />
</wt:row>
<wt:quote>表达式可以进行简单的数学计算,其中raw为原值参与计算</wt:quote>
<wt:row align="AlignEnum.Right">

View File

@ -9,7 +9,6 @@
<wt:display field="Entity.Method" />
<wt:display field="Entity.DeviceAddress" />
<wt:display field="Entity.DataType" />
<wt:display field="Entity.IsTrigger" />
<wt:display field="Entity.Expressions" />
<wt:display field="Entity.ProtectType" />
<wt:display field="Entity.Device.DeviceName" />

View File

@ -2,19 +2,16 @@
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.Name" />
<wt:display field="Entity.Description" />
<wt:display field="Entity.Method" />
<wt:display field="Entity.DeviceAddress" />
<wt:display field="Entity.DataType" />
<wt:display field="Entity.IsTrigger" />
<wt:display field="Entity.EndianType" />
<wt:display field="Entity.Expressions" />
<wt:display field="Entity.ProtectType" />
<wt:display field="Entity.Device.DeviceName" />
<wt:display field="Entity.Alias" />
</wt:row>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.Name" />
<wt:display field="Entity.Description" />
<wt:display field="Entity.Method" />
<wt:display field="Entity.DeviceAddress" />
<wt:display field="Entity.DataType" />
<wt:display field="Entity.Expressions" />
<wt:display field="Entity.ProtectType" />
<wt:display field="Entity.Device.DeviceName" />
</wt:row>
<wt:row align="AlignEnum.Right">
<wt:closebutton />
</wt:row>

View File

@ -10,12 +10,8 @@
<wt:combobox field="Entity.Method" items=AllMethods />
<wt:textbox field="Entity.DeviceAddress" />
<wt:combobox field="Entity.DataType" />
<wt:switch field="Entity.IsTrigger" />
<wt:combobox field="Entity.EndianType" />
<wt:textbox field="Entity.Expressions" />
<wt:switch field="Entity.IsUpload" />
<wt:combobox field="Entity.ProtectType" />
<wt:textbox field="Entity.Alias" />
</wt:row>
<wt:quote>表达式可以进行简单的数学计算,其中raw为原值参与计算</wt:quote>
<wt:hidden field="Entity.ID" />

View File

@ -22,61 +22,39 @@
clientId: 'mqttjs_' + (Math.random() * 10000000).toString()
}
var client = mqtt.connect('ws://' + window.location.host + '/mqtt', options);
client.on('connect',
function() {
client.subscribe('internal/v1/gateway/telemetry/+/+',
function(err) {
if (!err) {
console.log("订阅成功!");
} else {
console.log(err);
}
});
});
client.on('connect', function () {
client.subscribe('internal/v1/gateway/telemetry/+/+', function (err) {
if (!err) {
console.log("订阅成功!")
} else {
console.log(err)
}
})
})
client.on('message',
function(topic, message) {
var objmsg = $.parseJSON(message.toString());
client.on('message', function (topic, message) {
var objmsg = $.parseJSON(message.toString());
//原值
$('#id' + objmsg.VarId + '_Value').text(objmsg.Value);
$('#id' + objmsg.VarId + '_Value').addClass('animated bounceIn');
setTimeout(function() {
$('#id' + objmsg.VarId + '_Value').removeClass('bounceIn');
},
1500);
//原值
$('#id' + objmsg.VarId + '_Value').text(objmsg.Value);
$('#id' + objmsg.VarId + '_Value').addClass('animated bounceIn');
setTimeout(function(){
$('#id' + objmsg.VarId + '_Value').removeClass('bounceIn');
}, 1500);
//加工值
$('#id' + objmsg.VarId + '_CookedValue').text(objmsg.CookedValue);
$('#id' + objmsg.VarId + '_CookedValue').addClass('animated bounceIn');
setTimeout(function() {
$('#id' + objmsg.VarId + '_CookedValue').removeClass('bounceIn');
},
1500);
//加工值
$('#id' + objmsg.VarId + '_CookedValue').text(objmsg.CookedValue);
$('#id' + objmsg.VarId + '_CookedValue').addClass('animated bounceIn');
setTimeout(function(){
$('#id' + objmsg.VarId + '_CookedValue').removeClass('bounceIn');
}, 1500);
//状态
$('#id' + objmsg.VarId + '_State').text(objmsg.StatusType);
$('#id' + objmsg.VarId + '_State').addClass('animated bounceIn');
setTimeout(function() {
$('#id' + objmsg.VarId + '_State').removeClass('bounceIn');
},
1500);
//时间
$('#id' + objmsg.VarId + '_Timestamp').text(objmsg.Timestamp);
$('#id' + objmsg.VarId + '_Timestamp').addClass('animated bounceIn');
setTimeout(function () {
$('#id' + objmsg.VarId + '_Timestamp').removeClass('bounceIn');
},
1500);
//Message
$('#id' + objmsg.VarId + '_Message').text(objmsg.Message);
$('#id' + objmsg.VarId + '_Message').addClass('animated bounceIn');
setTimeout(function () {
$('#id' + objmsg.VarId + '_Message').removeClass('bounceIn');
},
1500);
});
//状态
$('#id' + objmsg.VarId + '_State').text(objmsg.StatusType);
$('#id' + objmsg.VarId + '_State').addClass('animated bounceIn');
setTimeout(function(){
$('#id' + objmsg.VarId + '_State').removeClass('bounceIn');
}, 1500);
})
}
</script>

Some files were not shown because too many files have changed in this diff Show More