Merge branch 'dev-V0.4.5' of https://gitee.com/iotkit-open-source/iotkit-parent into dev-V0.4.5

V0.5.x
荭琪枫 2023-06-14 23:27:10 +08:00
commit 20e349b4ad
40 changed files with 209 additions and 262 deletions

View File

@ -1,6 +1,6 @@
[
{
"id": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"id": "1",
"code": "DingTalk",
"title": "钉钉",
"icon": "http://www.baidu.com",

View File

@ -2,7 +2,7 @@
{
"id": "g3",
"name": "组3",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"remark": "2223333",
"deviceQty": 7,
"createAt": 0
@ -10,7 +10,7 @@
{
"id": "g2",
"name": "组2",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"remark": "222",
"deviceQty": 12,
"createAt": 0
@ -18,7 +18,7 @@
{
"id": "g1",
"name": "分组1",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"remark": "1111",
"deviceQty": 10,
"createAt": 0

View File

@ -5,7 +5,7 @@
"productKey": "PN3EDmkBZDD8whDd",
"deviceName": "MENCI0001008",
"secret": "rMAweEJrE7cxbQWa",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -31,7 +31,7 @@
"productKey": "PN3EDmkBZDD8whDd",
"deviceName": "MENCI0001007",
"secret": "eN4PjDhH4yx4mrmi",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -57,7 +57,7 @@
"productKey": "PN3EDmkBZDD8whDd",
"deviceName": "MENCI0001006",
"secret": "ePSkE7bzGMsR6rTs",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -83,7 +83,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001007",
"secret": "mkQiSDk4rF3EWKFM",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -112,7 +112,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001006",
"secret": "p72KAZyTA42zi8cJ",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -137,7 +137,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001005",
"secret": "xnKZZyPKj2rH6ee3",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -166,7 +166,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001004",
"secret": "PDkTxHPfw2H4WZjQ",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -191,7 +191,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001016",
"secret": "3KdPNBKZEyDGaNYK",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -216,7 +216,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001015",
"secret": "TBwbHJdJBQCpGdHi",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -241,7 +241,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001014",
"secret": "86pTYbQxxX3wd2FR",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -266,7 +266,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001013",
"secret": "FtxYcTM5p6B5GyPk",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -291,7 +291,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001012",
"secret": "5yHFHseBHDbCK3eZ",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -316,7 +316,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001011",
"secret": "pGC4z4TrbjZhii2m",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -341,7 +341,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001010",
"secret": "HMxT2rQ55bzeRNJx",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -366,7 +366,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001009",
"secret": "Z6yMp6D6mHKMjFi7",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -391,7 +391,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001008",
"secret": "Ek3ZjwPayCymDxhN",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -416,7 +416,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001007",
"secret": "NnnHaibdHJXMxNbC",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -441,7 +441,7 @@
"productKey": "Eit3kmGJtxSHfCKT",
"deviceName": "2475b491e72541f7ad60ee9025d8430e",
"secret": "bWkiEmY6wKM8WQP5",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false
@ -459,7 +459,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001006",
"secret": "FFSdNXDRJbnE8fm2",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [
"04c6722f-9a6d-40f3-ac9b-cd791b4c8933"
],
@ -497,7 +497,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001005",
"secret": "CN8ZGpcAheAbsDn2",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -516,7 +516,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001004",
"secret": "S4SDRKscRXAn43bc",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -541,7 +541,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001003",
"secret": "7N4S6eYzMCjA7YfK",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -560,7 +560,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001002",
"secret": "Jm7ecfyXawiend8K",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -585,7 +585,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "PULG0A001001",
"secret": "rtsZbST3tiJHccbe",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -610,7 +610,7 @@
"productKey": "eDhXKwEzwFybM5R7",
"deviceName": "SWITCH03001005",
"secret": "PXHwHXH4a8YJzZ3S",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -637,7 +637,7 @@
"productKey": "eDhXKwEzwFybM5R7",
"deviceName": "SWITCH03001004",
"secret": "BQj5SZetsC3eGtfM",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -664,7 +664,7 @@
"productKey": "eDhXKwEzwFybM5R7",
"deviceName": "SWITCH03001003",
"secret": "mbs4PsY4atEtzcA3",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -691,7 +691,7 @@
"productKey": "eDhXKwEzwFybM5R7",
"deviceName": "SWITCH03001002",
"secret": "4nrNrjnFMSQZB562",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -718,7 +718,7 @@
"productKey": "eDhXKwEzwFybM5R7",
"deviceName": "SWITCH03001001",
"secret": "Js66kBbXRjXmcpMB",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -739,7 +739,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01008",
"secret": "pGxKYrNJC7rDhsr8",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -758,7 +758,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01007",
"secret": "ZxDQeQ8jhMrfx8eE",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -777,7 +777,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01006",
"secret": "fEbdXEayedpBx6wk",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -796,7 +796,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01005",
"secret": "Crm28CTD6iw7hYw5",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -815,7 +815,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01004",
"secret": "FkCQGREXYCmjzxaZ",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -834,7 +834,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001003",
"secret": "JwKxnDWGrRcP8xAJ",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -853,7 +853,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001002",
"secret": "xrX2mrkQwf3YYaWc",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -872,7 +872,7 @@
"productKey": "xpsYHExTKPFaQMS7",
"deviceName": "LINGHT001001",
"secret": "diRBkEREDt47MzWF",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -891,7 +891,7 @@
"productKey": "hdX3PCMcFrCYpesJ",
"deviceName": "FAN0001003",
"secret": "fR3R3i8BYDKWAiDj",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false
@ -906,7 +906,7 @@
"productKey": "hdX3PCMcFrCYpesJ",
"deviceName": "FAN0001002",
"secret": "t3NYS5p7ExYaWKx4",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false
@ -921,7 +921,7 @@
"productKey": "hdX3PCMcFrCYpesJ",
"deviceName": "FAN0001001",
"secret": "KSpeRjXRP8H7tcAn",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false
@ -936,7 +936,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01003",
"secret": "DSBbhJW7cGXRWeZA",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -955,7 +955,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01002",
"secret": "5bm8pNYcdj7YPMXn",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -974,7 +974,7 @@
"productKey": "6kYp6jszrDns2yh4",
"deviceName": "WENSHIDU01001",
"secret": "neSfPnhsjCsQiCQx",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -993,7 +993,7 @@
"productKey": "PN3EDmkBZDD8whDd",
"deviceName": "MENCI0001003",
"secret": "2D2k8mmHbi2AMh8G",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1013,7 +1013,7 @@
"productKey": "PN3EDmkBZDD8whDd",
"deviceName": "MENCI0001002",
"secret": "AQHQJTQ2iXkncb3C",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1033,7 +1033,7 @@
"productKey": "PN3EDmkBZDD8whDd",
"deviceName": "MENCI0001001",
"secret": "PwYEKSARBJjD4y6B",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1053,7 +1053,7 @@
"productKey": "cGCrkK7Ex4FESAwe",
"deviceName": "TEST0012301",
"secret": "C8YxCycFFeQDPKX4",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1074,7 +1074,7 @@
"deviceName": "ABE12500001",
"model": "M1",
"parentId": "16514626212240aabbccee01000000143",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1097,7 +1097,7 @@
"productKey": "hbtgIA0SuVw9lxjB",
"deviceName": "AA:BB:CC:DD:10",
"model": "GW01",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false,
@ -1115,7 +1115,7 @@
"deviceName": "ABE12400001",
"model": "S1",
"parentId": "16514626212240aabbccee01000000143",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1176,7 +1176,7 @@
"deviceId": "16514626212240aabbccee01000000143",
"productKey": "N523nWsCiG3CAn6X",
"deviceName": "AA:BB:CC:EE:01",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1196,7 +1196,7 @@
"deviceName": "F4CCE4FEFFBD1BEC",
"model": "device",
"parentId": "165017126122400cefafcfee61000012b",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1541,7 +1541,7 @@
"deviceName": "ABD12300002",
"model": "F01",
"parentId": "16465226744430aabbccdd22000000143",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false,
@ -1563,7 +1563,7 @@
"deviceName": "ABD12300001",
"model": "F01",
"parentId": "16465226744430aabbccdd22000000143",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false,
@ -1583,7 +1583,7 @@
"deviceName": "ABC12300003",
"model": "S01",
"parentId": "16465226744430aabbccdd22000000143",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1604,7 +1604,7 @@
"deviceName": "ABC12300002",
"model": "S01",
"parentId": "16465226744430aabbccdd22000000143",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": true,
@ -1623,7 +1623,7 @@
"deviceId": "16465226744430aabbccdd22000000143",
"productKey": "hbtgIA0SuVw9lxjB",
"deviceName": "AA:BB:CC:DD:22",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false,
@ -1639,7 +1639,7 @@
"deviceId": "168187356997901234567891230000120",
"productKey": "BRD3x4fkKxkaxXFt",
"deviceName": "123456789123",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"subUid": [],
"state": {
"online": false,
@ -1655,7 +1655,7 @@
"deviceId": "168191541600402017121609130000126",
"productKey": "PwMfpXmp4ZWkGahn",
"deviceName": "201712160913",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"parentId": "168187356997901234567891230000120",
"subUid": [],
"state": {

View File

@ -4,7 +4,7 @@
"name": "调光灯",
"category": "light",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1650174777304
},
{
@ -13,7 +13,7 @@
"name": "智能风扇",
"category": "fan",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1646571291131
},
{
@ -21,7 +21,7 @@
"name": "GW01网关",
"category": "gateway",
"nodeType": 0,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/hbtgIA0SuVw9lxjB/cover.jpg?Expires=1967598154&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=2gh2jad14mVHGvWThwOd%2FykiB5g%3D",
"transparent": false,
"createAt": 1652238155938
@ -31,7 +31,7 @@
"name": "三路开关",
"category": "switch",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/eDhXKwEzwFybM5R7/cover.jpeg?Expires=1967598172&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=ZrFgANkomVEDQRV5JdmONL0S2sY%3D",
"transparent": false,
"createAt": 1652238173536
@ -41,7 +41,7 @@
"name": "插座",
"category": "SmartPlug",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/cGCrkK7Ex4FESAwe/cover.jpeg?Expires=1967598137&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=vOjqav0pRZqQFgx8xBo99WhgWXk%3D",
"transparent": false,
"createAt": 1652238138626
@ -51,7 +51,7 @@
"name": "一路开关",
"category": "switch",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/Rf4QSjbm65X45753/cover.jpeg?Expires=1967598145&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=ksQhmEm5Rn7C7FFqY09o9l%2BZ%2BIQ%3D",
"transparent": false,
"createAt": 1652238147123
@ -61,7 +61,7 @@
"name": "门磁",
"category": "door",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "null",
"createAt": 1650190400357
},
@ -70,7 +70,7 @@
"name": "ZGW01",
"category": "gateway",
"nodeType": 0,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/N523nWsCiG3CAn6X/cover.jpg?Expires=1967597641&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=%2BaGcHBT%2FHA3s%2BrZ687U50b4YE0A%3D",
"transparent": false,
"createAt": 1652237643216
@ -80,7 +80,7 @@
"name": "燃气表",
"category": "meter",
"nodeType": 2,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"transparent": false,
"createAt": 1654237604221
},
@ -89,7 +89,7 @@
"name": "通断器",
"category": "switch",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/DSGxxKk6E8mmDk6C/cover.jpeg?Expires=1967598201&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=k2PqHc%2BI14DfCwD8kQIflwoBAog%3D",
"transparent": false,
"createAt": 1652238202310
@ -99,7 +99,7 @@
"name": "四路场景面板",
"category": "switch",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1650187781637
},
{
@ -107,7 +107,7 @@
"name": "smart pulg",
"category": "SmartPlug",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"img": "http://iotkit-img.oss-cn-shenzhen.aliyuncs.com/product/AWcJnf7ymGSkaz5M/cover.jpeg?Expires=1967598035&OSSAccessKeyId=LTAI5tGEHNoVu5tWHUWnosrs&Signature=tXzWH5%2B4JNcnuTFrJbvGwsbx97c%3D",
"transparent": true,
"createAt": 1652279098100
@ -117,7 +117,7 @@
"name": "温湿度传感器",
"category": "sensor",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1649653149339
},
{
@ -125,7 +125,7 @@
"name": "新风",
"category": "FreshAir",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1649653149339
},
{
@ -133,7 +133,7 @@
"name": "智能电表采集器",
"category": "gateway",
"nodeType": 0,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1649653149339
},
{
@ -141,7 +141,7 @@
"name": "智能电表",
"category": "SmartMeter",
"nodeType": 1,
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1649653149339
}
]

View File

@ -1,7 +1,7 @@
[
{
"id": "eabb131d-8fd1-43a8-88d9-a198abfd3d42",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "MQTT标准协议组件",
"type": "device",
"protocol": "mqtt",
@ -14,7 +14,7 @@
},
{
"id": "6c095554-35e7-4e9d-a8d2-bb919e9479f4",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "EMQX标准协议组件",
"type": "device",
"protocol": "mqtt",
@ -27,7 +27,7 @@
},
{
"id": "3ababc5e-15e9-45a7-8f38-2a6afd45c780",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "小度音箱接入组件",
"type": "biz",
"protocol": "http",
@ -40,7 +40,7 @@
},
{
"id": "2c089bb8-0412-449e-94f1-212d35a50219",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "WEBSOCKET服务端",
"type": "device",
"protocol": "websocket",
@ -54,7 +54,7 @@
,
{
"id": "305a8b86-4566-4f2a-a57f-f84ca47471a1",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "DLT645电表通讯组件",
"type": "device",
"protocol": "tcp",

View File

@ -1,28 +1,28 @@
[
{
"id": "62995ba4dbf51a5ec41d5f7b",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "自定义表计协议",
"desc": "用于燃气表的协议",
"createAt": 1654217636597
},
{
"id": "628ceb14addfdb2a3b4b5727",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "奇特HTTP标准协议",
"desc": "奇特HTTP标准协议转换器",
"createAt": 1653402388275
},
{
"id": "6260396d67aced2696184053",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "奇特MQTT标准协议",
"desc": "奇特MQTT标准协议转换器",
"createAt": 1650473325173
},
{
"id": "d7e84930-5460-4638-aa3f-e0c2015628f4",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "WS标准协议",
"desc": "WS标准协议转换器",
"createAt": 1650473325173

View File

@ -29,7 +29,7 @@
"config": "{\"id\":\"de533da1-18cb-48ef-b913-22bdd96dcac9\",\"type\":\"http\",\"services\":[{\"url\":\"http://localhost:8087/aligenie/push\",\"script\":\"this.translate=function(msg){\\n var data={};\\n for(var p in msg.data){\\n\\tdata[p]=msg.data[p];\\n }\\n \\nreturn {\\n\\t//指定相对路径\\n path:\\\"/\\\",\\n method:\\\"post\\\",\\n header:{\\n //指定请求头\\n contentType:\\\"application/json; charset=utf-8\\\"\\n },\\n body:JSON.stringify({\\n deviceId:msg.deviceId,\\n type:msg.type,\\n identifier:msg.identifier,\\n data:data\\n })\\n }\\n}\"}]}"
}
],
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"state": "stopped",
"desc": "ss",
"createAt": 1649218592640
@ -60,7 +60,7 @@
"config": "{\"id\":\"35781aae-360f-4931-9d72-69f27e326e68\",\"type\":\"http\",\"services\":[{\"url\":\"https://xiaodu.baidu.com/saiya/smarthome/changereport\",\"script\":\"this.translate=function(msg,device){\\n var pk=msg.productKey;\\n var attributeName=\\\"\\\";\\n //插座/开关\\n if(pk==\\\"cGCrkK7Ex4FESAwe\\\" || pk==\\\"Rf4QSjbm65X45753\\\"){\\n\\tattributeName=\\\"turnOnState\\\";\\n }\\n //取openUid\\n var tag=device.tag;\\n if(!tag || !tag.duerosOpenUid){\\n\\treturn null;\\n }\\n var openUid=tag.duerosOpenUid.value;\\n \\n return {\\n \\\"path\\\":\\\"\\\",\\n \\\"method\\\":\\\"post\\\",\\n \\\"header\\\":{\\n //指定请求头\\n \\\"contentType\\\":\\\"application/json; charset=utf-8\\\"\\n },\\n \\\"body\\\":JSON.stringify({\\n\\t \\\"header\\\": {\\n\\t\\t \\\"namespace\\\": \\\"DuerOS.ConnectedHome.Control\\\",\\n\\t\\t \\\"name\\\": \\\"ChangeReportRequest\\\",\\n\\t\\t \\\"messageId\\\": new Date().getTime()+\\\"\\\",\\n\\t\\t \\\"payloadVersion\\\": \\\"1\\\"\\n\\t },\\n\\t \\\"payload\\\": {\\n\\t\\t \\\"botId\\\": \\\"eb20e515-f505-8d31-abef-46da3345f114\\\",\\n\\t\\t \\\"openUid\\\": openUid,\\n\\t\\t \\\"appliance\\\": {\\n\\t\\t\\t \\\"applianceId\\\": msg.deviceId,\\n\\t\\t\\t \\\"attributeName\\\": attributeName\\n\\t\\t }\\n\\t }\\n \\t})\\n }\\n}\"}]}"
}
],
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"state": "running",
"desc": "开关插座开关状态推送",
"createAt": 1652515471242
@ -87,7 +87,7 @@
"config": "{\"id\":\"fde024b5-5105-4639-8602-d04300613af9\",\"type\":\"device\",\"services\":[{\"device\":\"hdX3PCMcFrCYpesJ/ABD12300002\",\"identifier\":\"set\",\"inputData\":[{\"identifier\":\"powerSwitch\",\"value\":\"1\"}]},{\"device\":\"hdX3PCMcFrCYpesJ/ABD12300002\",\"identifier\":\"set\",\"inputData\":[{\"identifier\":\"windSpeed\",\"value\":\"20\"}]}]}"
}
],
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"state": "stopped",
"desc": "test",
"createAt": 1649167998895

View File

@ -12,9 +12,9 @@
}
],
"state": "stopped",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"createAt": 1645928016031,
"reason": "stop by fa1c5eaa-de6e-48b6-805e-8f091c7bb831"
"reason": "stop by 1"
},
{
"id": "667bbfa1-a7ed-4ce8-9ce0-cfa8cac90e6c",

View File

@ -2,7 +2,7 @@
{
"id": "629e1d7fa176d816952f1e81",
"uid": "13480802157",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"secret": "483752384B473759556E685768796B6F644E48634F76486C51646A41576B545A2B396C34474244414F334F78574F4778613764564338594E666770595A376177",
"nickName": "song2",
"type": 1,
@ -18,7 +18,7 @@
{
"id": "6286886077b91b031115e6a6",
"uid": "guest1",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "演示账户",
"secret": "48774861346645676F51324A4D6E6639306E6474437741634C4333746C4575666C316F76503455542B5836763065315A2F676244695056557356704D49513569",
"type": 0,
@ -31,9 +31,9 @@
"createAt": 1647592821770
},
{
"id": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"id": "1",
"uid": "iotkit",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "管理员",
"secret": "6E49354D37437030564370666E48486150524B3134743258735059354D75324F6532594478654C47767535614C6C6E767139625170774E576477785A34513369",
"type": 0,
@ -50,7 +50,7 @@
{
"id": "a1051e81-f4fc-4182-a750-1a53a27f4c71",
"uid": "du2",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "小度接入2",
"type": 1,
"roles": [
@ -64,7 +64,7 @@
{
"id": "5c0bea53-a318-42ed-a7c5-6e05e6db4ef2",
"uid": "tm3",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "天猫精灵test3",
"type": 1,
"roles": [
@ -78,7 +78,7 @@
{
"id": "2bb3e6f1-17ba-4bf5-9d5e-85fdffd8b85d",
"uid": "du1",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "小度接入1",
"secret": "483752384B473759556E685768796B6F644E48634F76486C51646A41576B545A2B396C34474244414F334F517674507547437A72627A7154302B724441734C5A",
"type": 1,
@ -94,7 +94,7 @@
{
"id": "0ca377e2-66ff-49f3-90c3-108a86bc90eb",
"uid": "tm1",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "天猫精灵1",
"type": 1,
"roles": [
@ -108,7 +108,7 @@
{
"id": "04c6722f-9a6d-40f3-ac9b-cd791b4c8933",
"uid": "18126045687",
"ownerId": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"ownerId": "1",
"nickName": "song",
"secret": "483752384B473759556E685768796B6F644E48634F76486C51646A41576B545A2B396C34474244414F334F517674507547437A72627A7154302B724441734C5A",
"type": 1,

View File

@ -1,7 +1,7 @@
[
{
"id":"6293953092084e2df303ba3e",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "三路开关",
"productKey": "eDhXKwEzwFybM5R7",
"devices": [
@ -20,7 +20,7 @@
},
{
"id":"629391ae92084e2df303ba3d",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "温湿度传感器",
"productKey": "6kYp6jszrDns2yh4",
"devices": [
@ -44,7 +44,7 @@
},
{
"id": "629390f492084e2df303ba3c",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "调光灯",
"productKey": "xpsYHExTKPFaQMS7",
"devices": [
@ -65,7 +65,7 @@
},
{
"id": "62925cb72002b44c15caeb1c",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "虚拟门磁1",
"productKey": "PN3EDmkBZDD8whDd",
"devices": [
@ -86,7 +86,7 @@
},
{
"id": "628fd800fba69e633a972e12",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "开关1",
"productKey": "Rf4QSjbm65X45753",
"devices": [
@ -102,7 +102,7 @@
},
{
"id": "628fa6bc1b735b73cb260042",
"uid": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831",
"uid": "1",
"name": "虚拟插座12",
"productKey": "cGCrkK7Ex4FESAwe",
"devices": [

View File

@ -24,4 +24,6 @@ public interface IProductData extends IOwnedData<Product, String> {
*/
List<Product> findByCategory(String category);
}

View File

@ -1,12 +1,11 @@
package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IProductData;
import cc.iotkit.data.dao.ProductRepository;
import cc.iotkit.data.manager.IProductData;
import cc.iotkit.data.model.TbProduct;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.product.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
@ -15,7 +14,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
@Primary
@ -37,7 +35,7 @@ public class ProductDataImpl implements IProductData, IJPACommData<Product, Stri
@Override
public Class getTClass() {
return null;
return Product.class;
}
@Override

View File

@ -80,7 +80,7 @@ public class SysDeptDataImpl implements ISysDeptData, IJPACommData<SysDept, Long
@Override
public List<SysDept> findByDeptId(Long deptId) {
return MapstructUtils.convert(deptRepository.findAll().stream().filter(o -> o.getAncestors().indexOf(deptId.toString()) != -1)
return MapstructUtils.convert(deptRepository.findAll().stream().filter(o -> o.getAncestors() != null && o.getAncestors().contains(deptId.toString()))
.collect(Collectors.toList()), SysDept.class);
}
@ -95,7 +95,7 @@ public class SysDeptDataImpl implements ISysDeptData, IJPACommData<SysDept, Long
.from(tbSysDept)
.where(predicateBuilder.build())
.fetchOne();
return count==0;
return count == 0;
}
@Override

View File

@ -5,7 +5,6 @@ import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.SysRoleMenuRepository;
import cc.iotkit.data.model.QTbSysRoleMenu;
import cc.iotkit.data.model.TbSysRoleMenu;
import cc.iotkit.data.model.TbSysUserRole;
import cc.iotkit.data.system.ISysRoleMenuData;
import cc.iotkit.data.util.PredicateBuilder;
import cc.iotkit.model.system.SysRoleMenu;
@ -15,7 +14,9 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import static cc.iotkit.data.model.QTbSysRoleMenu.tbSysRoleMenu;
@ -50,13 +51,12 @@ public class SysRoleMenuDataImpl implements ISysRoleMenuData, IJPACommData<SysRo
@Override
public boolean checkMenuExistRole(Long menuId) {
TbSysRoleMenu tbSysRoleMenu = jpaQueryFactory
.select(QTbSysRoleMenu.tbSysRoleMenu)
return jpaQueryFactory
.select(QTbSysRoleMenu.tbSysRoleMenu.count())
.from(QTbSysRoleMenu.tbSysRoleMenu)
.where(PredicateBuilder.instance()
.and(QTbSysRoleMenu.tbSysRoleMenu.menuId.eq(menuId))
.build()).fetchOne();
return Objects.nonNull(tbSysRoleMenu);
.build()).fetchOne() > 0;
}
@Override

View File

@ -3,6 +3,7 @@ package cc.iotkit.common.log.event;
import cn.hutool.http.useragent.UserAgent;
import lombok.Data;
import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;
/**
@ -45,6 +46,10 @@ public class LogininforEvent implements Serializable {
*/
private UserAgent userAgent;
/**
*
*/
private HttpServletRequest request;
/**
*
*/

View File

@ -19,7 +19,7 @@ import java.util.List;
public class AuthUtil {
public static String getUserId() {
return StpUtil.getLoginId().toString();
return String.valueOf(LoginHelper.getUserId());
}
public static List<String> getUserRoles() {
@ -27,7 +27,7 @@ public class AuthUtil {
}
public static boolean isAdmin() {
return AuthUtil.getUserRoles().contains(Constants.ROLE_ADMIN);
return LoginHelper.isSuperAdmin();
}
public static boolean isClientUser() {

View File

@ -181,6 +181,7 @@ public class DeviceController {
return productService.getThingModelByProductKey(deviceInfo.getProductKey());
}
@ApiOperation("添加标签")
@PostMapping("/tag/add")
public boolean addTag(@Validated @RequestBody Request<DeviceTagAddBo> bo) {
return deviceServiceImpl.addTag(bo.getData());
@ -197,6 +198,7 @@ public class DeviceController {
/**
*
*/
@ApiOperation("消费设备信息消息(实时推送设备信息)")
@PostMapping("/consumer")
public DeferredResult<ThingModelMessage> consumerDeviceInfo(
@Validated @RequestBody Request<DeviceConsumerBo> bo
@ -208,6 +210,7 @@ public class DeviceController {
/**
*
*/
@ApiOperation(value = "获取分组列表")
@PostMapping("/groups/list")
public Paging<DeviceGroupVo> getDeviceGroups(
@Validated @RequestBody PageRequest<DeviceGroupBo> pageRequest) {

View File

@ -10,19 +10,20 @@
package cc.iotkit.manager.controller;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.api.Request;
import cc.iotkit.common.log.annotation.Log;
import cc.iotkit.common.log.enums.BusinessType;
import cc.iotkit.common.validate.AddGroup;
import cc.iotkit.common.validate.EditGroup;
import cc.iotkit.manager.dto.bo.category.CategoryBo;
import cc.iotkit.manager.dto.bo.product.ProductBo;
import cc.iotkit.manager.dto.bo.productmodel.ProductModelBo;
import cc.iotkit.manager.dto.bo.thingmodel.ThingModelBo;
import cc.iotkit.manager.dto.vo.thingmodel.ThingModelVo;
import cc.iotkit.manager.dto.vo.category.CategoryVo;
import cc.iotkit.manager.dto.vo.product.ProductVo;
import cc.iotkit.manager.dto.vo.productmodel.ProductModelVo;
import cc.iotkit.common.api.Paging;
import cc.iotkit.manager.dto.vo.thingmodel.ThingModelVo;
import cc.iotkit.manager.service.IProductService;
import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.annotations.Api;
@ -48,6 +49,7 @@ public class ProductController {
private IProductService productService;
@PostMapping("/list")
@ApiOperation("列表")
public Paging<ProductVo> getProducts(@Validated @RequestBody
PageRequest<ProductBo> request) {
return productService.selectPageList(request);
@ -65,20 +67,20 @@ public class ProductController {
@ApiOperation(value = "编辑产品")
@PostMapping("/edit")
@Log(title = "产品", businessType = BusinessType.UPDATE)
public boolean edit(@RequestBody @Validated ProductBo productBo) {
return productService.updateEntity(productBo);
public boolean edit(@Validated(EditGroup.class) @RequestBody Request<ProductBo> request) {
return productService.updateEntity(request.getData());
}
@ApiOperation("查看详情")
@PostMapping(value = "/getDetail")
public ProductVo getDetail(@RequestParam @Validated Request<String> request) {
public ProductVo getDetail(@RequestBody @Validated Request<String> request) {
ProductVo dto = productService.getDetail(request.getData());
return dto;
}
@PostMapping("/getThingModelByProductKey")
@ApiOperation("查看物模型")
public ThingModelVo getThingModelByProductKey(@RequestParam @Validated Request<String> request) {
public ThingModelVo getThingModelByProductKey(@RequestBody @Validated Request<String> request) {
return productService.getThingModelByProductKey(request.getData());
@ -102,11 +104,17 @@ public class ProductController {
@PostMapping("/category/list")
@ApiOperation("产品品类展示")
@ApiOperation("产品品类分页展示")
public Paging<CategoryVo> getCategories(@Validated @RequestBody PageRequest<CategoryBo> request) {
return productService.selectCategoryPageList(request);
}
@PostMapping("/category/getList")
@ApiOperation("产品品类展示")
public List<CategoryVo> getCategorieList() {
return productService.selectCategoryList();
}
@SaCheckRole("iot_admin")
@ApiOperation("品类编辑")
@PostMapping("/category/edit")
@ -123,6 +131,7 @@ public class ProductController {
}
@ApiOperation("上传产品图片")
@PostMapping("/uploadImg/{productKey}")
public String uploadImg(@PathVariable("productKey") String productKey,
@RequestParam("file") MultipartFile file) {

View File

@ -10,44 +10,21 @@
package cc.iotkit.manager.controller;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.api.Request;
import cc.iotkit.common.enums.ErrCode;
import cc.iotkit.common.exception.BizException;
import cc.iotkit.common.satoken.utils.AuthUtil;
import cc.iotkit.common.utils.ReflectUtil;
import cc.iotkit.comps.ComponentManager;
import cc.iotkit.comps.config.ComponentConfig;
import cc.iotkit.data.manager.IProtocolComponentData;
import cc.iotkit.data.manager.IProtocolConverterData;
import cc.iotkit.data.manager.IUserInfoData;
import cc.iotkit.manager.dto.bo.ChangeStateBo;
import cc.iotkit.manager.dto.bo.protocolcomponent.ProtocolComponentBo;
import cc.iotkit.manager.dto.bo.protocolconverter.ProtocolConverterBo;
import cc.iotkit.manager.dto.vo.protocolcomponent.ProtocolComponentVo;
import cc.iotkit.manager.dto.vo.protocolconverter.ProtocolConverterVo;
import cc.iotkit.manager.service.DataOwnerService;
import cc.iotkit.common.api.Paging;
import cc.iotkit.manager.service.IProtocolService;
import cc.iotkit.model.protocol.ProtocolComponent;
import cc.iotkit.model.protocol.ProtocolConverter;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.nio.file.*;
import java.util.Objects;
import java.util.UUID;
@Api(tags = {"协议"})
@RestController
@RequestMapping("/protocol")
@ -119,7 +96,7 @@ public class ProtocolController {
@ApiOperation("修改转换脚本")
@PostMapping("/converter/edit")
public boolean editConverter(Request<ProtocolConverterBo> req) {
public boolean editConverter(@Validated @RequestBody Request<ProtocolConverterBo> req) {
return protocolService.editConverter(req.getData());
}
@ -149,7 +126,7 @@ public class ProtocolController {
return protocolService.deleteConverter(id);
}
@PostMapping("/component/changeState}")
@PostMapping("/component/changeState")
@ApiOperation("组件启用/禁用")
public boolean changeComponentState(@RequestBody @Validated Request<ChangeStateBo> req) {
return protocolService.changeComponentState(req.getData());

View File

@ -27,6 +27,7 @@ import java.util.List;
@Api(tags = {"空间"})
@RestController
@RequestMapping("/space")
@Deprecated
public class SpaceController {
@Autowired

View File

@ -39,6 +39,7 @@ import java.util.stream.Collectors;
@Api(tags = {"空间设备"})
@RestController
@RequestMapping("/space")
@Deprecated
public class SpaceDeviceController {
@Autowired

View File

@ -33,6 +33,7 @@ import java.util.UUID;
@Api(tags = {"用户"})
@RestController
@RequestMapping("/user")
@Deprecated
public class UserInfoController {
@Autowired

View File

@ -61,7 +61,8 @@ public class DataOwnerService {
}
}
throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION);
// throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION);暂时先注释,重新设计
return data;
}
/**
@ -89,7 +90,8 @@ public class DataOwnerService {
return;
}
throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION);
// throw new BizException(ErrCode.UNAUTHORIZED_EXCEPTION);暂时先注释,重新设计
return;
}
/**

View File

@ -6,10 +6,10 @@ import cc.iotkit.manager.dto.bo.category.CategoryBo;
import cc.iotkit.manager.dto.bo.product.ProductBo;
import cc.iotkit.manager.dto.bo.productmodel.ProductModelBo;
import cc.iotkit.manager.dto.bo.thingmodel.ThingModelBo;
import cc.iotkit.manager.dto.vo.thingmodel.ThingModelVo;
import cc.iotkit.manager.dto.vo.product.ProductVo;
import cc.iotkit.manager.dto.vo.category.CategoryVo;
import cc.iotkit.manager.dto.vo.product.ProductVo;
import cc.iotkit.manager.dto.vo.productmodel.ProductModelVo;
import cc.iotkit.manager.dto.vo.thingmodel.ThingModelVo;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -45,6 +45,8 @@ public interface IProductService {
Paging<CategoryVo> selectCategoryPageList(PageRequest<CategoryBo> request);
List<CategoryVo> selectCategoryList();
List<ProductModelVo> getModels(String productKey);
boolean editProductModel(ProductModelBo productModel);

View File

@ -4,7 +4,6 @@ import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.enums.ErrCode;
import cc.iotkit.common.exception.BizException;
import cc.iotkit.common.satoken.utils.AuthUtil;
import cc.iotkit.common.utils.JsonUtils;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.manager.ICategoryData;
@ -16,10 +15,10 @@ import cc.iotkit.manager.dto.bo.category.CategoryBo;
import cc.iotkit.manager.dto.bo.product.ProductBo;
import cc.iotkit.manager.dto.bo.productmodel.ProductModelBo;
import cc.iotkit.manager.dto.bo.thingmodel.ThingModelBo;
import cc.iotkit.manager.dto.vo.thingmodel.ThingModelVo;
import cc.iotkit.manager.dto.vo.category.CategoryVo;
import cc.iotkit.manager.dto.vo.product.ProductVo;
import cc.iotkit.manager.dto.vo.productmodel.ProductModelVo;
import cc.iotkit.manager.dto.vo.thingmodel.ThingModelVo;
import cc.iotkit.manager.service.DataOwnerService;
import cc.iotkit.manager.service.IProductService;
import cc.iotkit.model.product.Category;
@ -182,9 +181,9 @@ public class ProductServiceImpl implements IProductService {
@Override
public Paging<ProductVo> selectPageList(PageRequest<ProductBo> request) {
if (!AuthUtil.isAdmin()) {
return productData.findByUid(AuthUtil.getUserId(), request.getPageNum(), request.getPageSize()).to(ProductVo.class);
}
// if (!AuthUtil.isAdmin()) {
// return productData.findByUid(AuthUtil.getUserId(), request.getPageNum(), request.getPageSize()).to(ProductVo.class);
// }
return productData.findAll(request.to(Product.class)).to(ProductVo.class);
}
@ -195,6 +194,12 @@ public class ProductServiceImpl implements IProductService {
}
@Override
public List<CategoryVo> selectCategoryList() {
return MapstructUtils.convert(categoryData.findAll(), CategoryVo.class);
}
@Override
public List<ProductModelVo> getModels(String productKey) {
dataOwnerService.checkOwner(productData, productKey);

View File

@ -51,9 +51,9 @@ public class SysConfigController extends BaseController {
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@SaCheckPermission("system:config:export")
@PostMapping("/export")
public void export(@RequestBody @Validated(QueryGroup.class) Request<SysConfigBo> config,
public void export(@Validated(QueryGroup.class) SysConfigBo config,
HttpServletResponse response) {
List<SysConfigVo> list = configService.selectConfigList(config.getData());
List<SysConfigVo> list = configService.selectConfigList(config);
ExcelUtil.exportExcel(list, "参数数据", SysConfigVo.class, response);
}

View File

@ -52,8 +52,8 @@ public class SysDictDataController {
@SaCheckPermission("system:dict:export")
@ApiOperation(value = "导出字典数据列表", notes = "导出字典数据列表")
@PostMapping("/export")
public void export(@RequestBody @Validated Request<SysDictDataBo> bo, HttpServletResponse response) {
List<SysDictDataVo> list = dictDataService.selectDictDataList(bo.getData());
public void export(SysDictDataBo bo, HttpServletResponse response) {
List<SysDictDataVo> list = dictDataService.selectDictDataList(bo);
ExcelUtil.exportExcel(list, "字典数据", SysDictDataVo.class, response);
}

View File

@ -55,16 +55,14 @@ public class SysDictTypeController extends BaseController {
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@SaCheckPermission("system:dict:export")
@PostMapping("/export")
public void export(@RequestBody @Validated(QueryGroup.class)PageRequest<SysDictTypeBo> dictType, HttpServletResponse response) {
public void export(@Validated(QueryGroup.class) SysDictTypeBo dictType, HttpServletResponse response) {
List<SysDictTypeVo> list = dictTypeService.selectDictTypeList(dictType.getData());
List<SysDictTypeVo> list = dictTypeService.selectDictTypeList(dictType);
ExcelUtil.exportExcel(list, "字典类型", SysDictTypeVo.class, response);
}
/**
*
*
*/
@ApiOperation(value = "查询字典类型详细", notes = "查询字典类型详细")
@SaCheckPermission("system:dict:query")
@ -111,8 +109,8 @@ public class SysDictTypeController extends BaseController {
@SaCheckPermission("system:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@PostMapping("/delete")
public void remove(@RequestBody @Validated Collection<Long> dictIds) {
dictTypeService.deleteDictTypeByIds(dictIds);
public void remove(@RequestBody @Validated Request<List<Long>> dictIds) {
dictTypeService.deleteDictTypeByIds(dictIds.getData());
}
/**

View File

@ -54,8 +54,8 @@ public class SysLogininforController extends BaseController {
@Log(title = "登录日志", businessType = BusinessType.EXPORT)
@SaCheckPermission("monitor:logininfor:export")
@PostMapping("/export")
public void export(Request<SysLogininforBo> logininfor, HttpServletResponse response) {
List<SysLogininforVo> list = logininforService.selectLogininforList(logininfor.getData());
public void export(SysLogininforBo logininfor, HttpServletResponse response) {
List<SysLogininforVo> list = logininforService.selectLogininforList(logininfor);
ExcelUtil.exportExcel(list, "登录日志", SysLogininforVo.class, response);
}

View File

@ -54,8 +54,8 @@ public class SysPostController extends BaseController {
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@SaCheckPermission("system:post:export")
@PostMapping("/export")
public void export(@RequestBody @Validated(QueryGroup.class) Request<SysPostBo> post, HttpServletResponse response) {
List<SysPostVo> list = postService.selectPostList(post.getData());
public void export(@Validated(QueryGroup.class) SysPostBo post, HttpServletResponse response) {
List<SysPostVo> list = postService.selectPostList(post);
ExcelUtil.exportExcel(list, "岗位数据", SysPostVo.class, response);
}

View File

@ -59,8 +59,8 @@ public class SysRoleController extends BaseController {
@ApiOperation(value = "导出角色信息列表", notes = "导出角色信息列表")
@SaCheckPermission("system:role:export")
@PostMapping("/export")
public void export(@RequestBody @Validated Request<SysRoleBo> role, HttpServletResponse response) {
List<SysRoleVo> list = roleService.selectRoleList(role.getData());
public void export(@Validated SysRoleBo role, HttpServletResponse response) {
List<SysRoleVo> list = roleService.selectRoleList(role);
ExcelUtil.exportExcel(list, "角色数据", SysRoleVo.class, response);
}

View File

@ -62,8 +62,8 @@ public class SysTenantController extends BaseController {
@SaCheckPermission("system:tenant:export")
@Log(title = "租户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(Request<SysTenantBo> bo, HttpServletResponse response) {
List<SysTenantVo> list = tenantService.queryList(bo.getData());
public void export(SysTenantBo bo, HttpServletResponse response) {
List<SysTenantVo> list = tenantService.queryList(bo);
ExcelUtil.exportExcel(list, "租户", SysTenantVo.class, response);
}

View File

@ -69,9 +69,8 @@ public class SysUserController extends BaseController {
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@SaCheckPermission("system:user:export")
@PostMapping("/export")
public void export(@RequestBody @Validated(QueryGroup.class) Request<SysUserBo> req,
public void export(@Validated(QueryGroup.class) SysUserBo user,
HttpServletResponse response) {
SysUserBo user = req.getData();
List<SysUserVo> list = userService.selectUserList(user);
List<SysUserExportVo> listVo = MapstructUtils.convert(list, SysUserExportVo.class);
ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response);

View File

@ -22,7 +22,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**

View File

@ -15,7 +15,6 @@ import cc.iotkit.data.system.ISysDictData;
import cc.iotkit.data.system.ISysDictTypeData;
import cc.iotkit.model.system.SysDictData;
import cc.iotkit.model.system.SysDictType;
import cc.iotkit.model.system.SysUser;
import cc.iotkit.system.dto.bo.SysDictTypeBo;
import cc.iotkit.system.dto.vo.SysDictDataVo;
import cc.iotkit.system.dto.vo.SysDictTypeVo;
@ -41,7 +40,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
private final ISysDictData sysDictData;
@Override
public Paging<SysDictTypeVo> selectPageDictTypeList( PageRequest<SysDictTypeBo> query) {
public Paging<SysDictTypeVo> selectPageDictTypeList(PageRequest<SysDictTypeBo> query) {
return sysDictTypeData.findAll(query.to(SysDictType.class)).to(SysDictTypeVo.class);
}
@ -153,8 +152,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
@Override
public List<SysDictDataVo> updateDictType(SysDictTypeBo bo) {
SysDictType oldDict = sysDictTypeData.findById(bo.getId());
List<SysDictData> olds=sysDictData.findByDicType(oldDict.getDictType());
for (SysDictData sd:olds) {
List<SysDictData> olds = sysDictData.findByDicType(oldDict.getDictType());
for (SysDictData sd : olds) {
sd.setDictType(bo.getDictType());
sysDictData.save(sd);
}
@ -189,7 +188,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
// 优先从本地缓存获取
List<SysDictDataVo> datas = (List<SysDictDataVo>) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType);
if (ObjectUtil.isNull(datas)) {
datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType);
datas = selectDictDataByType(dictType);
SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas);
}

View File

@ -7,19 +7,21 @@ import cc.iotkit.common.log.event.LogininforEvent;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.common.utils.StringUtils;
import cc.iotkit.common.utils.ip.AddressUtils;
import cc.iotkit.common.web.utils.ServletUtils;
import cc.iotkit.data.system.ISysLogininforData;
import cc.iotkit.data.util.PageBuilder;
import cc.iotkit.model.system.SysLogininfor;
import cc.iotkit.system.dto.bo.SysLogininforBo;
import cc.iotkit.system.dto.vo.SysLogininforVo;
import cc.iotkit.system.service.ISysLogininforService;
import cn.hutool.http.useragent.UserAgent;
import cn.hutool.http.useragent.UserAgentUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@ -44,7 +46,10 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
@Async
@EventListener
public void recordLogininfor(LogininforEvent logininforEvent) {
String ip = logininforEvent.getIp();
HttpServletRequest request = logininforEvent.getRequest();
final UserAgent userAgent = UserAgentUtil.parse(request.getHeader("User-Agent"));
final String ip = ServletUtils.getClientIP();
String address = AddressUtils.getRealAddressByIP(ip);
StringBuilder s = new StringBuilder();
s.append(getBlock(ip));
@ -54,7 +59,6 @@ public class SysLogininforServiceImpl implements ISysLogininforService {
s.append(getBlock(logininforEvent.getMessage()));
// 打印信息到日志
log.info(s.toString(), logininforEvent.getArgs());
UserAgent userAgent = logininforEvent.getUserAgent();
// 获取客户端操作系统
String os = userAgent.getOs().getName();
// 获取客户端浏览器

View File

@ -24,7 +24,6 @@ import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import org.hibernate.service.spi.ServiceException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -335,7 +334,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
checkRoleDataScope(roleId);
SysRole role = iSysRoleData.findById(roleId);
if (countUserRoleByRoleId(roleId) > 0) {
throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
throw new BizException(String.format("%1$s已分配,不能删除", role.getRoleName()));
}
}

View File

@ -34,7 +34,6 @@ public class Application {
if (EmbeddedRedisConfig.embeddedEnable()) {
EmbeddedRedisConfig.startEmbeddedRedisServer();
}
System.setProperty("nashorn.args","--no-deprecation-warning");
SpringApplication.run(Application.class, args);
System.out.println("server start success!");

View File

@ -2,7 +2,6 @@ package cc.iotkit.web.controller;
import cc.iotkit.common.constant.Constants;
import cc.iotkit.common.constant.GlobalConstants;
import cc.iotkit.common.exception.BizException;
import cc.iotkit.common.redis.utils.RedisUtils;
import cc.iotkit.common.utils.ReflectUtils;
import cc.iotkit.common.utils.SpringUtils;
@ -14,13 +13,10 @@ import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.captcha.AbstractCaptcha;
import cn.hutool.captcha.generator.CodeGenerator;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
@ -29,8 +25,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
/**
*
@ -46,56 +40,6 @@ import java.util.Map;
public class CaptchaController {
private final CaptchaProperties captchaProperties;
// private final SmsProperties smsProperties;
// private final MailProperties mailProperties;
/**
*
*
* @param phonenumber
*/
// @PostMapping("/resource/sms/code")
// public void smsCode(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
// if (!smsProperties.getEnabled()) {
// throw new BizException("当前系统没有开启短信功能!");
// }
// String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
// String code = RandomUtil.randomNumbers(4);
// RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
// // 验证码模板id 自行处理 (查数据库或写死均可)
// String templateId = "";
// Map<String, String> map = new HashMap<>(1);
// map.put("code", code);
// SmsTemplate smsTemplate = SpringUtils.getBean(SmsTemplate.class);
// SmsResult result = smsTemplate.send(phonenumber, templateId, map);
// if (!result.isSuccess()) {
// log.error("验证码短信发送异常 => {}", result);
// throw new RuntimeException("验证码短信发送异常");
// }
// return ;
// }
/**
*
*
* @param email
*/
// @PostMapping("/resource/email/code")
// public void emailCode(@NotBlank(message = "{user.email.not.blank}") String email) {
// if (!mailProperties.getEnabled()) {
// throw new BizException("当前系统没有开启邮件功能!"));
// }
// String key = GlobalConstants.CAPTCHA_CODE_KEY + email;
// String code = RandomUtil.randomNumbers(4);
// RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
// try {
// MailUtils.sendText(email, "登录验证码", "您本次验证码为:" + code + ",有效性为" + Constants.CAPTCHA_EXPIRATION + "分钟,请尽快填写。");
// } catch (Exception e) {
// log.error("验证码短信发送异常 => {}", e.getMessage());
// throw new RuntimeException("验证码短信发送异常");
// }
//
// }
/**
*

View File

@ -7,16 +7,14 @@ import cc.iotkit.common.enums.LoginType;
import cc.iotkit.common.enums.UserStatus;
import cc.iotkit.common.exception.BizException;
import cc.iotkit.common.exception.user.UserException;
import cc.iotkit.common.log.event.LogininforEvent;
import cc.iotkit.common.redis.utils.RedisUtils;
import cc.iotkit.common.satoken.utils.LoginHelper;
import cc.iotkit.common.tenant.helper.TenantHelper;
import cc.iotkit.common.undefined.LoginUser;
import cc.iotkit.common.undefined.RoleDTO;
import cc.iotkit.common.undefined.XcxLoginUser;
import cc.iotkit.common.utils.DateUtils;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.common.utils.MessageUtils;
import cc.iotkit.common.utils.StringUtils;
import cc.iotkit.common.utils.*;
import cc.iotkit.common.web.config.properties.CaptchaProperties;
import cc.iotkit.common.web.utils.ServletUtils;
import cc.iotkit.data.system.ISysUserData;
@ -29,16 +27,12 @@ import cn.dev33.satoken.secure.BCrypt;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.Date;
import java.util.List;
import java.util.function.Supplier;
@ -177,7 +171,13 @@ public class SysLoginService {
* @param message
*/
private void recordLogininfor(String tenantId, String username, String status, String message) {
LogininforEvent logininforEvent = new LogininforEvent();
logininforEvent.setTenantId(tenantId);
logininforEvent.setUsername(username);
logininforEvent.setStatus(status);
logininforEvent.setMessage(message);
logininforEvent.setRequest(ServletUtils.getRequest());
SpringUtils.context().publishEvent(logininforEvent);
}
/**