From 5f7b1fbb44d68417e5a064ae85922cf115274bda Mon Sep 17 00:00:00 2001 From: regan <915353449@qq.com> Date: Tue, 13 Jun 2023 21:46:33 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cc/iotkit/manager/controller/ProductController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java index 375121af..6a43f100 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java @@ -48,6 +48,7 @@ public class ProductController { private IProductService productService; @PostMapping("/list") + @ApiOperation("列表") public Paging getProducts(@Validated @RequestBody PageRequest request) { return productService.selectPageList(request); From ab1fa5db2cb029ba33df955cc9aacc224229222e Mon Sep 17 00:00:00 2001 From: xiwa Date: Wed, 14 Jun 2023 01:04:55 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iotkit/data/service/SysDeptDataImpl.java | 4 +- .../data/service/SysRoleMenuDataImpl.java | 12 ++-- .../controller/SysConfigController.java | 4 +- .../controller/SysDictDataController.java | 4 +- .../controller/SysDictTypeController.java | 4 +- .../controller/SysLogininforController.java | 4 +- .../system/controller/SysPostController.java | 4 +- .../system/controller/SysRoleController.java | 4 +- .../controller/SysTenantController.java | 4 +- .../system/controller/SysUserController.java | 3 +- .../service/impl/SysConfigServiceImpl.java | 1 - .../service/impl/SysDictTypeServiceImpl.java | 9 ++- .../impl/SysLogininforServiceImpl.java | 1 - .../service/impl/SysRoleServiceImpl.java | 3 +- .../src/main/java/cc/iotkit/Application.java | 1 - .../web/controller/CaptchaController.java | 56 ------------------- .../iotkit/web/service/SysLoginService.java | 4 -- 17 files changed, 28 insertions(+), 94 deletions(-) diff --git a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysDeptDataImpl.java b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysDeptDataImpl.java index e1d06b37..15d67c6a 100644 --- a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysDeptDataImpl.java +++ b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysDeptDataImpl.java @@ -80,7 +80,7 @@ public class SysDeptDataImpl implements ISysDeptData, IJPACommData 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 0; } @Override diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java index 3fb76f7d..3631fcd3 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java @@ -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 config, + public void export(@Validated(QueryGroup.class) SysConfigBo config, HttpServletResponse response) { - List list = configService.selectConfigList(config.getData()); + List list = configService.selectConfigList(config); ExcelUtil.exportExcel(list, "参数数据", SysConfigVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java index 4c79f9fe..c08cc4e7 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictDataController.java @@ -52,8 +52,8 @@ public class SysDictDataController { @SaCheckPermission("system:dict:export") @ApiOperation(value = "导出字典数据列表", notes = "导出字典数据列表") @PostMapping("/export") - public void export(@RequestBody @Validated Request bo, HttpServletResponse response) { - List list = dictDataService.selectDictDataList(bo.getData()); + public void export(SysDictDataBo bo, HttpServletResponse response) { + List list = dictDataService.selectDictDataList(bo); ExcelUtil.exportExcel(list, "字典数据", SysDictDataVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java index 9233d895..746cadfb 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java @@ -55,9 +55,9 @@ public class SysDictTypeController extends BaseController { @Log(title = "字典类型", businessType = BusinessType.EXPORT) @SaCheckPermission("system:dict:export") @PostMapping("/export") - public void export(@RequestBody @Validated(QueryGroup.class)PageRequest dictType, HttpServletResponse response) { + public void export(@Validated(QueryGroup.class) SysDictTypeBo dictType, HttpServletResponse response) { - List list = dictTypeService.selectDictTypeList(dictType.getData()); + List list = dictTypeService.selectDictTypeList(dictType); ExcelUtil.exportExcel(list, "字典类型", SysDictTypeVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysLogininforController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysLogininforController.java index 7e636a52..d21b0a2e 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysLogininforController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysLogininforController.java @@ -54,8 +54,8 @@ public class SysLogininforController extends BaseController { @Log(title = "登录日志", businessType = BusinessType.EXPORT) @SaCheckPermission("monitor:logininfor:export") @PostMapping("/export") - public void export(Request logininfor, HttpServletResponse response) { - List list = logininforService.selectLogininforList(logininfor.getData()); + public void export(SysLogininforBo logininfor, HttpServletResponse response) { + List list = logininforService.selectLogininforList(logininfor); ExcelUtil.exportExcel(list, "登录日志", SysLogininforVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java index 7f0bb0e7..b27663cb 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysPostController.java @@ -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 post, HttpServletResponse response) { - List list = postService.selectPostList(post.getData()); + public void export(@Validated(QueryGroup.class) SysPostBo post, HttpServletResponse response) { + List list = postService.selectPostList(post); ExcelUtil.exportExcel(list, "岗位数据", SysPostVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java index 735345d3..83214581 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java @@ -59,8 +59,8 @@ public class SysRoleController extends BaseController { @ApiOperation(value = "导出角色信息列表", notes = "导出角色信息列表") @SaCheckPermission("system:role:export") @PostMapping("/export") - public void export(@RequestBody @Validated Request role, HttpServletResponse response) { - List list = roleService.selectRoleList(role.getData()); + public void export(@Validated SysRoleBo role, HttpServletResponse response) { + List list = roleService.selectRoleList(role); ExcelUtil.exportExcel(list, "角色数据", SysRoleVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java index bad950a4..a005530c 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysTenantController.java @@ -62,8 +62,8 @@ public class SysTenantController extends BaseController { @SaCheckPermission("system:tenant:export") @Log(title = "租户", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(Request bo, HttpServletResponse response) { - List list = tenantService.queryList(bo.getData()); + public void export(SysTenantBo bo, HttpServletResponse response) { + List list = tenantService.queryList(bo); ExcelUtil.exportExcel(list, "租户", SysTenantVo.class, response); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java index ddc25e89..66ffa8af 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysUserController.java @@ -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 req, + public void export(@Validated(QueryGroup.class) SysUserBo user, HttpServletResponse response) { - SysUserBo user = req.getData(); List list = userService.selectUserList(user); List listVo = MapstructUtils.convert(list, SysUserExportVo.class); ExcelUtil.exportExcel(listVo, "用户数据", SysUserExportVo.class, response); diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java index 1e152362..0ac714b0 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java @@ -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; /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java index 6d48e4d9..f80e9489 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysDictTypeServiceImpl.java @@ -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 selectPageDictTypeList( PageRequest query) { + public Paging selectPageDictTypeList(PageRequest query) { return sysDictTypeData.findAll(query.to(SysDictType.class)).to(SysDictTypeVo.class); } @@ -153,8 +152,8 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService @Override public List updateDictType(SysDictTypeBo bo) { SysDictType oldDict = sysDictTypeData.findById(bo.getId()); - List olds=sysDictData.findByDicType(oldDict.getDictType()); - for (SysDictData sd:olds) { + List 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 datas = (List) 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); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java index 459c9720..613aafb8 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java @@ -8,7 +8,6 @@ import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.StringUtils; import cc.iotkit.common.utils.ip.AddressUtils; 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; diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java index c2ba2475..11c3520d 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java @@ -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())); } } diff --git a/iot-starter/src/main/java/cc/iotkit/Application.java b/iot-starter/src/main/java/cc/iotkit/Application.java index 7ec4272b..ad5130f7 100644 --- a/iot-starter/src/main/java/cc/iotkit/Application.java +++ b/iot-starter/src/main/java/cc/iotkit/Application.java @@ -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!"); diff --git a/iot-starter/src/main/java/cc/iotkit/web/controller/CaptchaController.java b/iot-starter/src/main/java/cc/iotkit/web/controller/CaptchaController.java index 23dc62b2..f05f5ec0 100644 --- a/iot-starter/src/main/java/cc/iotkit/web/controller/CaptchaController.java +++ b/iot-starter/src/main/java/cc/iotkit/web/controller/CaptchaController.java @@ -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 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("验证码短信发送异常"); -// } -// -// } /** * 生成验证码 diff --git a/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java b/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java index 9bbc3055..b2ade2fa 100644 --- a/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java +++ b/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java @@ -29,16 +29,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; From 4da69a75088eff717f9c892163f0e15d04b0f241 Mon Sep 17 00:00:00 2001 From: xiwa Date: Wed, 14 Jun 2023 01:12:40 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=E5=88=A0=E9=99=A4=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/iotkit/system/controller/SysDictTypeController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java index 746cadfb..8fc9f3e1 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysDictTypeController.java @@ -63,8 +63,6 @@ public class SysDictTypeController extends BaseController { /** * 查询字典类型详细 - * - */ @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 dictIds) { - dictTypeService.deleteDictTypeByIds(dictIds); + public void remove(@RequestBody @Validated Request> dictIds) { + dictTypeService.deleteDictTypeByIds(dictIds.getData()); } /** From 071ce2adbe79321a01ff178928faa0b8177a679c Mon Sep 17 00:00:00 2001 From: tangfudong <280620913@qq.com> Date: Wed, 14 Jun 2023 09:23:47 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E5=8E=9F=E6=9C=89=E6=95=B0=E6=8D=AE=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProtocolController.java | 27 ++----------------- .../manager/service/DataOwnerService.java | 6 +++-- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java index 5459b006..dbba49de 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java @@ -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 req) { + public boolean editConverter(@Validated @RequestBody Request req) { return protocolService.editConverter(req.getData()); } diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java index 8ab3aa2c..567b9318 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/DataOwnerService.java @@ -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; } /** From aadef99a30de4594be2fd86cc818c5a6c673f6a2 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 11:18:54 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iotkit/common/log/event/LogininforEvent.java | 5 +++++ .../service/impl/SysLogininforServiceImpl.java | 9 +++++++-- .../cc/iotkit/web/service/SysLoginService.java | 14 +++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java b/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java index b0703181..dde592b3 100644 --- a/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java +++ b/iot-common/iot-common-log/src/main/java/cc/iotkit/common/log/event/LogininforEvent.java @@ -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; /** * 其他参数 */ diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java index 613aafb8..e57f15cd 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysLogininforServiceImpl.java @@ -7,18 +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.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; @@ -43,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)); @@ -53,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(); // 获取客户端浏览器 diff --git a/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java b/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java index b2ade2fa..27b331c2 100644 --- a/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java +++ b/iot-starter/src/main/java/cc/iotkit/web/service/SysLoginService.java @@ -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; @@ -173,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); } /** From d462408ebdb7a6de19f5c50953c3a565d7499175 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 11:25:08 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cc/iotkit/manager/controller/ProductController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java index 6a43f100..5f79f4f2 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProductController.java @@ -73,13 +73,13 @@ public class ProductController { @ApiOperation("查看详情") @PostMapping(value = "/getDetail") - public ProductVo getDetail(@RequestParam @Validated Request request) { + public ProductVo getDetail(@RequestBody @Validated Request request) { ProductVo dto = productService.getDetail(request.getData()); return dto; } @PostMapping("/getThingModelByProductKey") @ApiOperation("查看物模型") - public ThingModelVo getThingModelByProductKey(@RequestParam @Validated Request request) { + public ThingModelVo getThingModelByProductKey(@RequestBody @Validated Request request) { return productService.getThingModelByProductKey(request.getData()); From 34ff78dfac4bb404c81995e2629a0d8c4d0d465c Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 11:29:12 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix:=20=E7=BB=84=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cc/iotkit/manager/controller/ProtocolController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java index dbba49de..cc12b775 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/ProtocolController.java @@ -126,7 +126,7 @@ public class ProtocolController { return protocolService.deleteConverter(id); } - @PostMapping("/component/changeState}") + @PostMapping("/component/changeState") @ApiOperation("组件启用/禁用") public boolean changeComponentState(@RequestBody @Validated Request req) { return protocolService.changeComponentState(req.getData()); From da6548e9d8c19ecc09242d74c8cee5196a5154ec Mon Sep 17 00:00:00 2001 From: tangfudong <280620913@qq.com> Date: Wed, 14 Jun 2023 11:58:10 +0800 Subject: [PATCH 08/12] =?UTF-8?q?fix:=E4=BA=A7=E5=93=81=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/iotkit/data/manager/IProductData.java | 2 ++ .../iotkit/data/service/ProductDataImpl.java | 8 +++----- .../manager/controller/ProductController.java | 18 +++++++++++++----- .../manager/service/IProductService.java | 6 ++++-- .../service/impl/ProductServiceImpl.java | 15 ++++++++++----- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/manager/IProductData.java b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/manager/IProductData.java index 68da54b6..ed765adc 100644 --- a/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/manager/IProductData.java +++ b/iot-common/iot-common-dao/iot-data-service/src/main/java/cc/iotkit/data/manager/IProductData.java @@ -24,4 +24,6 @@ public interface IProductData extends IOwnedData { */ List findByCategory(String category); + + } diff --git a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/ProductDataImpl.java b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/ProductDataImpl.java index 9920d84f..cfb7816d 100644 --- a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/ProductDataImpl.java +++ b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/ProductDataImpl.java @@ -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 request) { + return productService.updateEntity(request.getData()); } @@ -103,11 +104,17 @@ public class ProductController { @PostMapping("/category/list") - @ApiOperation("产品品类展示") + @ApiOperation("产品品类分页展示") public Paging getCategories(@Validated @RequestBody PageRequest request) { return productService.selectCategoryPageList(request); } + @PostMapping("/category/getList") + @ApiOperation("产品品类展示") + public List getCategorieList() { + return productService.selectCategoryList(); + } + @SaCheckRole("iot_admin") @ApiOperation("品类编辑") @PostMapping("/category/edit") @@ -124,6 +131,7 @@ public class ProductController { } + @ApiOperation("上传产品图片") @PostMapping("/uploadImg/{productKey}") public String uploadImg(@PathVariable("productKey") String productKey, @RequestParam("file") MultipartFile file) { diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java index 35ce1da6..1b1e45c3 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/IProductService.java @@ -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 selectCategoryPageList(PageRequest request); + List selectCategoryList(); + List getModels(String productKey); boolean editProductModel(ProductModelBo productModel); diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java index fa87bccb..ff4a0a76 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/service/impl/ProductServiceImpl.java @@ -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 selectPageList(PageRequest 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 selectCategoryList() { + return MapstructUtils.convert(categoryData.findAll(), CategoryVo.class); + + } + @Override public List getModels(String productKey) { dataOwnerService.checkOwner(productData, productKey); From 747baf5adf26fa85d48d32d4d12f6cd894f48027 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 14:20:31 +0800 Subject: [PATCH 09/12] =?UTF-8?q?fix:=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/init/channel.json | 2 +- data/init/deviceGroup.json | 6 +- data/init/deviceInfo.json | 118 +++++++++++++++---------------- data/init/product.json | 32 ++++----- data/init/protocolComponent.json | 10 +-- data/init/protocolConverter.json | 8 +-- data/init/ruleInfo.json | 6 +- data/init/taskInfo.json | 4 +- data/init/userInfo.json | 18 ++--- data/init/virtualDevice.json | 12 ++-- 10 files changed, 108 insertions(+), 108 deletions(-) diff --git a/data/init/channel.json b/data/init/channel.json index 2bf58f64..cd74fb49 100644 --- a/data/init/channel.json +++ b/data/init/channel.json @@ -1,6 +1,6 @@ [ { - "id": "fa1c5eaa-de6e-48b6-805e-8f091c7bb831", + "id": "1", "code": "DingTalk", "title": "钉钉", "icon": "http://www.baidu.com", diff --git a/data/init/deviceGroup.json b/data/init/deviceGroup.json index 46fb9c64..6eede68e 100755 --- a/data/init/deviceGroup.json +++ b/data/init/deviceGroup.json @@ -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 diff --git a/data/init/deviceInfo.json b/data/init/deviceInfo.json index 88cfba7e..c89f5ec0 100755 --- a/data/init/deviceInfo.json +++ b/data/init/deviceInfo.json @@ -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": { diff --git a/data/init/product.json b/data/init/product.json index 2ba94ac3..0663534f 100755 --- a/data/init/product.json +++ b/data/init/product.json @@ -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 } ] \ No newline at end of file diff --git a/data/init/protocolComponent.json b/data/init/protocolComponent.json index 59220bed..64a67b00 100644 --- a/data/init/protocolComponent.json +++ b/data/init/protocolComponent.json @@ -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", diff --git a/data/init/protocolConverter.json b/data/init/protocolConverter.json index 5d4b0707..b16e083c 100755 --- a/data/init/protocolConverter.json +++ b/data/init/protocolConverter.json @@ -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 diff --git a/data/init/ruleInfo.json b/data/init/ruleInfo.json index c298f075..f879d648 100755 --- a/data/init/ruleInfo.json +++ b/data/init/ruleInfo.json @@ -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 diff --git a/data/init/taskInfo.json b/data/init/taskInfo.json index 59a1b9bc..c9f731e9 100755 --- a/data/init/taskInfo.json +++ b/data/init/taskInfo.json @@ -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", diff --git a/data/init/userInfo.json b/data/init/userInfo.json index b1a71e2a..771d5247 100755 --- a/data/init/userInfo.json +++ b/data/init/userInfo.json @@ -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, diff --git a/data/init/virtualDevice.json b/data/init/virtualDevice.json index f7ecdc6a..82d140ab 100755 --- a/data/init/virtualDevice.json +++ b/data/init/virtualDevice.json @@ -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": [ From b263c34ef8881de3aa551c1b90f6a11699989de0 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 14:41:53 +0800 Subject: [PATCH 10/12] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cc/iotkit/common/satoken/utils/AuthUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iot-common/iot-common-satoken/src/main/java/cc/iotkit/common/satoken/utils/AuthUtil.java b/iot-common/iot-common-satoken/src/main/java/cc/iotkit/common/satoken/utils/AuthUtil.java index 849dad39..8fc59b4c 100644 --- a/iot-common/iot-common-satoken/src/main/java/cc/iotkit/common/satoken/utils/AuthUtil.java +++ b/iot-common/iot-common-satoken/src/main/java/cc/iotkit/common/satoken/utils/AuthUtil.java @@ -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 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() { From 6036282986f848d756f70ff598db14f437a7f49e Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 14:47:13 +0800 Subject: [PATCH 11/12] =?UTF-8?q?refactor:=20=E5=BC=83=E7=94=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cc/iotkit/manager/controller/SpaceController.java | 1 + .../java/cc/iotkit/manager/controller/SpaceDeviceController.java | 1 + .../java/cc/iotkit/manager/controller/UserInfoController.java | 1 + 3 files changed, 3 insertions(+) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceController.java index f84b19a4..25c1aade 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceController.java @@ -27,6 +27,7 @@ import java.util.List; @Api(tags = {"空间"}) @RestController @RequestMapping("/space") +@Deprecated public class SpaceController { @Autowired diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceDeviceController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceDeviceController.java index 3abfc9d4..567b3320 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceDeviceController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/SpaceDeviceController.java @@ -39,6 +39,7 @@ import java.util.stream.Collectors; @Api(tags = {"空间设备"}) @RestController @RequestMapping("/space") +@Deprecated public class SpaceDeviceController { @Autowired diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/UserInfoController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/UserInfoController.java index d535ad5a..7c667785 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/UserInfoController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/UserInfoController.java @@ -33,6 +33,7 @@ import java.util.UUID; @Api(tags = {"用户"}) @RestController @RequestMapping("/user") +@Deprecated public class UserInfoController { @Autowired From d7b65e3ae1ec25c5d1bab8869cdff5649c6ae76c Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 14 Jun 2023 14:54:41 +0800 Subject: [PATCH 12/12] =?UTF-8?q?docs:=20=E8=AE=BE=E5=A4=87=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cc/iotkit/manager/controller/DeviceController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java index 489f622a..6880d78f 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/DeviceController.java @@ -181,6 +181,7 @@ public class DeviceController { return productService.getThingModelByProductKey(deviceInfo.getProductKey()); } + @ApiOperation("添加标签") @PostMapping("/tag/add") public boolean addTag(@Validated @RequestBody Request bo) { return deviceServiceImpl.addTag(bo.getData()); @@ -197,6 +198,7 @@ public class DeviceController { /** * 消费设备信息消息(实时推送设备信息) */ + @ApiOperation("消费设备信息消息(实时推送设备信息)") @PostMapping("/consumer") public DeferredResult consumerDeviceInfo( @Validated @RequestBody Request bo @@ -208,6 +210,7 @@ public class DeviceController { /** * 获取分组列表 */ + @ApiOperation(value = "获取分组列表") @PostMapping("/groups/list") public Paging getDeviceGroups( @Validated @RequestBody PageRequest pageRequest) {