diff --git a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysMenuDataImpl.java b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysMenuDataImpl.java index d4449bef..52d2deda 100644 --- a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysMenuDataImpl.java +++ b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysMenuDataImpl.java @@ -161,13 +161,14 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData selectMenuTreeAll() { - return jpaQueryFactory.select(Projections.bean(SysMenu.class, tbSysMenu.perms.countDistinct())) + List rets= jpaQueryFactory.select(tbSysMenu) .from(tbSysMenu) .where(PredicateBuilder.instance() .and(tbSysMenu.menuType.in(UserConstants.TYPE_DIR, UserConstants.TYPE_MENU)) .and(tbSysMenu.status.eq(UserConstants.MENU_NORMAL)) .build()) .orderBy(tbSysMenu.parentId.asc(), tbSysMenu.orderNum.asc()).fetch(); + return MapstructUtils.convert(rets,SysMenu.class); } @Override diff --git a/iot-module/iot-generator/src/main/java/cc/iotkit/generator/controller/GenController.java b/iot-module/iot-generator/src/main/java/cc/iotkit/generator/controller/GenController.java index aa1e7012..18ced508 100644 --- a/iot-module/iot-generator/src/main/java/cc/iotkit/generator/controller/GenController.java +++ b/iot-module/iot-generator/src/main/java/cc/iotkit/generator/controller/GenController.java @@ -41,7 +41,7 @@ public class GenController extends BaseController { * 查询代码生成列表 */ @SaCheckPermission("tool:gen:list") - @GetMapping("/list") + @PostMapping("/list") public Paging genList(GenTable genTable, PageQuery pageQuery) { return genTableService.selectPageGenTableList(genTable, pageQuery); } @@ -52,7 +52,7 @@ public class GenController extends BaseController { * @param tableId 表ID */ @SaCheckPermission("tool:gen:query") - @GetMapping(value = "/{tableId}") + @PostMapping(value = "/{tableId}") public Map getInfo(@PathVariable Long tableId) { GenTable table = genTableService.selectGenTableById(tableId); List tables = genTableService.selectGenTableAll(); @@ -68,7 +68,7 @@ public class GenController extends BaseController { * 查询数据库列表 */ @SaCheckPermission("tool:gen:list") - @GetMapping("/db/list") + @PostMapping("/db/list") public Paging dataList(GenTable genTable, PageQuery pageQuery) { return genTableService.selectPageDbTableList(genTable, pageQuery); } @@ -79,7 +79,7 @@ public class GenController extends BaseController { * @param tableId 表ID */ @SaCheckPermission("tool:gen:list") - @GetMapping(value = "/column/{tableId}") + @PostMapping(value = "/column/{tableId}") public Paging columnList(Long tableId) { List list = genTableService.selectGenTableColumnListByTableId(tableId); @@ -134,7 +134,7 @@ public class GenController extends BaseController { * @param tableId 表ID */ @SaCheckPermission("tool:gen:preview") - @GetMapping("/preview/{tableId}") + @PostMapping("/preview/{tableId}") public Map preview(@PathVariable("tableId") Long tableId) throws IOException { Map dataMap = genTableService.previewCode(tableId); return dataMap; @@ -147,7 +147,7 @@ public class GenController extends BaseController { */ @SaCheckPermission("tool:gen:code") @Log(title = "代码生成", businessType = BusinessType.GENCODE) - @GetMapping("/download/{tableName}") + @PostMapping("/download/{tableName}") public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { byte[] data = genTableService.downloadCode(tableName); genCode(response, data); @@ -160,7 +160,7 @@ public class GenController extends BaseController { */ @SaCheckPermission("tool:gen:code") @Log(title = "代码生成", businessType = BusinessType.GENCODE) - @GetMapping("/genCode/{tableName}") + @PostMapping("/genCode/{tableName}") public void genCode(@PathVariable("tableName") String tableName) { genTableService.generatorCode(tableName); return ; @@ -173,7 +173,7 @@ public class GenController extends BaseController { */ @SaCheckPermission("tool:gen:edit") @Log(title = "代码生成", businessType = BusinessType.UPDATE) - @GetMapping("/synchDb/{tableName}") + @PostMapping("/synchDb/{tableName}") public void synchDb(@PathVariable("tableName") String tableName) { genTableService.synchDb(tableName); return ; @@ -186,7 +186,7 @@ public class GenController extends BaseController { */ @SaCheckPermission("tool:gen:code") @Log(title = "代码生成", businessType = BusinessType.GENCODE) - @GetMapping("/batchGenCode") + @PostMapping("/batchGenCode") public void batchGenCode(HttpServletResponse response, String tables) throws IOException { String[] tableNames = Convert.toStrArray(tables); byte[] data = genTableService.downloadCode(tableNames); diff --git a/iot-module/iot-generator/src/main/resources/vm/java/controller.java.vm b/iot-module/iot-generator/src/main/resources/vm/java/controller.java.vm index e31d68df..08d02bd6 100644 --- a/iot-module/iot-generator/src/main/resources/vm/java/controller.java.vm +++ b/iot-module/iot-generator/src/main/resources/vm/java/controller.java.vm @@ -43,7 +43,7 @@ public class ${ClassName}Controller extends BaseController { * 查询${functionName}列表 */ @SaCheckPermission("${permissionPrefix}:list") - @GetMapping("/list") + @PostMapping("/list") #if($table.crud || $table.sub) public TableDataInfo<${ClassName}Vo> list(${ClassName}Bo bo, PageQuery pageQuery) { return ${className}Service.queryPageList(bo, pageQuery); @@ -72,7 +72,7 @@ public class ${ClassName}Controller extends BaseController { * @param ${pkColumn.javaField} 主键 */ @SaCheckPermission("${permissionPrefix}:query") - @GetMapping("/{${pkColumn.javaField}}") + @PostMapping("/{${pkColumn.javaField}}") public R<${ClassName}Vo> getInfo(@NotNull(message = "主键不能为空") @PathVariable ${pkColumn.javaType} ${pkColumn.javaField}) { return R.ok(${className}Service.queryById(${pkColumn.javaField})); 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 13800a9e..375121af 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 @@ -76,7 +76,7 @@ public class ProductController { ProductVo dto = productService.getDetail(request.getData()); return dto; } - @GetMapping("/getThingModelByProductKey") + @PostMapping("/getThingModelByProductKey") @ApiOperation("查看物模型") public ThingModelVo getThingModelByProductKey(@RequestParam @Validated Request request) { 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 f234f1e3..f84b19a4 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 @@ -39,7 +39,7 @@ public class SpaceController { /** * 取用户当前家庭 */ - @GetMapping("/currentHome") + @PostMapping("/currentHome") public Home getCurrentHome() { return homeData.findByUidAndCurrent(AuthUtil.getUserId(), true); } @@ -47,7 +47,7 @@ public class SpaceController { /** * 取用户所有家庭 */ - @GetMapping("/getUserHomes") + @PostMapping("/getUserHomes") public List getUserHomes() { return homeData.findByUid(AuthUtil.getUserId()); } @@ -87,7 +87,7 @@ public class SpaceController { /** * 我的空间列表 */ - @GetMapping("/spaces/{homeId}") + @PostMapping("/spaces/{homeId}") public List getSpaces(@PathVariable("homeId") String homeId) { return spaceData.findByUidAndHomeIdOrderByCreateAtDesc(AuthUtil.getUserId(), homeId); } 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 35111be6..3abfc9d4 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 @@ -65,7 +65,7 @@ public class SpaceDeviceController { /** * 我最近使用的设备列表 */ - @GetMapping(Constants.API_SPACE.RECENT_DEVICES) + @PostMapping(Constants.API_SPACE.RECENT_DEVICES) public List getMyRecentDevices() { List spaceDevices = spaceDeviceData.findByUidOrderByUseAtDesc(AuthUtil.getUserId()); return spaceDevices.stream().map((this::parseSpaceDevice)).collect(Collectors.toList()); @@ -74,7 +74,7 @@ public class SpaceDeviceController { /** * 获取用户收藏设备列表 */ - @GetMapping(Constants.API_SPACE.GET_COLLECT_DEVICES) + @PostMapping(Constants.API_SPACE.GET_COLLECT_DEVICES) public List getCollectDevices() { Home home=homeData.findByUidAndCurrent(AuthUtil.getUserId(), true); List spaceDevices = spaceDeviceData.findByHomeIdAndCollect(home.getId(),true); @@ -97,7 +97,7 @@ public class SpaceDeviceController { * * @param spaceId 空间id */ - @GetMapping(Constants.API_SPACE.SPACE_DEVICES) + @PostMapping(Constants.API_SPACE.SPACE_DEVICES) public List getMyDevices(@PathVariable("spaceId") String spaceId) { String uid = AuthUtil.getUserId(); List spaceDevices; @@ -141,7 +141,7 @@ public class SpaceDeviceController { /** * 获取用户所有设备列表 */ - @GetMapping("/{userId}/devices") + @PostMapping("/{userId}/devices") public List getDevices(@PathVariable("userId") String userId) { List spaceDevices = spaceDeviceData.findByUid(userId); return spaceDevices.stream().map((this::parseSpaceDevice)).collect(Collectors.toList()); @@ -150,7 +150,7 @@ public class SpaceDeviceController { /** * 搜索未添加过的设备 */ - @GetMapping(Constants.API_SPACE.FIND_DEVICE) + @PostMapping(Constants.API_SPACE.FIND_DEVICE) List findDevice(String mac) { if (StringUtils.isBlank(mac)) { throw new BizException(ErrCode.DATA_BLANK); @@ -308,7 +308,7 @@ public class SpaceDeviceController { /** * 获取房间中指定设备信息 */ - @GetMapping(Constants.API_SPACE.GET_DEVICE) + @PostMapping(Constants.API_SPACE.GET_DEVICE) public SpaceDeviceVo getSpaceDevice(@PathVariable("deviceId") String deviceId) { String uid = AuthUtil.getUserId(); SpaceDevice spaceDevice = spaceDeviceData.findByDeviceIdAndUid(deviceId, uid); diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/StatsController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/StatsController.java index b41b58cd..27c28571 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/StatsController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/StatsController.java @@ -19,7 +19,7 @@ import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -40,7 +40,7 @@ public class StatsController { @Autowired private IThingModelMessageData thingModelMessageData; - @GetMapping("/main") + @PostMapping("/main") public MainStats getMainStats() { MainStats mainStats = new MainStats(); String uid = AuthUtil.getUserId(); 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 d251f920..d535ad5a 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 @@ -48,7 +48,7 @@ public class UserInfoController { * 平台用户列表 */ @SaCheckRole("iot_admin") - @GetMapping("/platform/users") + @PostMapping("/platform/users") public List getPlatformUsers() { return userInfoData.findByType(UserInfo.USER_TYPE_PLATFORM); } @@ -94,7 +94,7 @@ public class UserInfoController { /** * 客户端用户列表 */ - @GetMapping("/client/users") + @PostMapping("/client/users") public List clientUsers() { return userInfoData.findByTypeAndOwnerId(UserInfo.USER_TYPE_CLIENT, AuthUtil.getUserId()); } diff --git a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java index 7592f7e2..4e94b61d 100644 --- a/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java +++ b/iot-module/iot-manager/src/main/java/cc/iotkit/manager/controller/VirtualDeviceController.java @@ -95,7 +95,7 @@ public class VirtualDeviceController { * 获取虚拟设备详情 */ @ApiOperation("获取虚拟设备详情") - @GetMapping("/getDetail") + @PostMapping("/getDetail") public VirtualDevice detail(@Validated @RequestBody Request bo) { return checkOwner(bo.getData()); } diff --git a/iot-starter/src/main/java/cc/iotkit/web/controller/AuthController.java b/iot-starter/src/main/java/cc/iotkit/web/controller/AuthController.java index cf06426b..b7b08ed0 100644 --- a/iot-starter/src/main/java/cc/iotkit/web/controller/AuthController.java +++ b/iot-starter/src/main/java/cc/iotkit/web/controller/AuthController.java @@ -6,7 +6,6 @@ import cc.iotkit.common.undefined.EmailLoginBody; import cc.iotkit.common.undefined.LoginBody; import cc.iotkit.common.undefined.RegisterBody; import cc.iotkit.common.undefined.SmsLoginBody; -import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.StreamUtils; import cc.iotkit.common.utils.StringUtils; import cc.iotkit.system.dto.bo.SysTenantBo; @@ -147,7 +146,7 @@ public class AuthController { * @return 租户列表 */ @ApiOperation("登录页面租户下拉框") - @GetMapping("/tenant/list") + @PostMapping("/tenant/list") public LoginTenantVo tenantList(HttpServletRequest request) throws Exception { List tenantList = tenantService.queryList(new SysTenantBo()); List voList = tenantList.stream().map(t -> TenantListVo.builder() 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 14722592..23dc62b2 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 @@ -25,7 +25,7 @@ import org.springframework.expression.Expression; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import java.time.Duration; @@ -54,7 +54,7 @@ public class CaptchaController { * * @param phonenumber 用户手机号 */ -// @GetMapping("/resource/sms/code") +// @PostMapping("/resource/sms/code") // public void smsCode(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) { // if (!smsProperties.getEnabled()) { // throw new BizException("当前系统没有开启短信功能!"); @@ -80,7 +80,7 @@ public class CaptchaController { * * @param email 邮箱 */ -// @GetMapping("/resource/email/code") +// @PostMapping("/resource/email/code") // public void emailCode(@NotBlank(message = "{user.email.not.blank}") String email) { // if (!mailProperties.getEnabled()) { // throw new BizException("当前系统没有开启邮件功能!")); @@ -101,7 +101,7 @@ public class CaptchaController { * 生成验证码 */ @ApiOperation(value = "生成验证码") - @GetMapping("/code") + @PostMapping("/code") public CaptchaVo getCode() { CaptchaVo captchaVo = new CaptchaVo(); boolean captchaEnabled = captchaProperties.getEnable(); diff --git a/iot-test-tool/iot-virtual-device/src/main/java/cc/iotkit/virtualdevice/VirtualManager.java b/iot-test-tool/iot-virtual-device/src/main/java/cc/iotkit/virtualdevice/VirtualManager.java index c82c6cd1..66ca738e 100644 --- a/iot-test-tool/iot-virtual-device/src/main/java/cc/iotkit/virtualdevice/VirtualManager.java +++ b/iot-test-tool/iot-virtual-device/src/main/java/cc/iotkit/virtualdevice/VirtualManager.java @@ -50,7 +50,7 @@ public class VirtualManager { private IVirtualDeviceLogData virtualDeviceLogData; - @PostConstruct +// @PostConstruct public void init() { new Timer().schedule(new TimerTask() { @Override