update:将所有请求改为post
parent
165449fcb8
commit
b00e57cf33
|
@ -161,13 +161,14 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData<SysMenu, Long
|
|||
|
||||
@Override
|
||||
public List<SysMenu> selectMenuTreeAll() {
|
||||
return jpaQueryFactory.select(Projections.bean(SysMenu.class, tbSysMenu.perms.countDistinct()))
|
||||
List<TbSysMenu> 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
|
||||
|
|
|
@ -41,7 +41,7 @@ public class GenController extends BaseController {
|
|||
* 查询代码生成列表
|
||||
*/
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping("/list")
|
||||
@PostMapping("/list")
|
||||
public Paging<GenTable> 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<String, Object> getInfo(@PathVariable Long tableId) {
|
||||
GenTable table = genTableService.selectGenTableById(tableId);
|
||||
List<GenTable> tables = genTableService.selectGenTableAll();
|
||||
|
@ -68,7 +68,7 @@ public class GenController extends BaseController {
|
|||
* 查询数据库列表
|
||||
*/
|
||||
@SaCheckPermission("tool:gen:list")
|
||||
@GetMapping("/db/list")
|
||||
@PostMapping("/db/list")
|
||||
public Paging<GenTable> 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<GenTableColumn> columnList(Long tableId) {
|
||||
|
||||
List<GenTableColumn> 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<String, String> preview(@PathVariable("tableId") Long tableId) throws IOException {
|
||||
Map<String, String> 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);
|
||||
|
|
|
@ -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}));
|
||||
|
|
|
@ -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<String> request) {
|
||||
|
||||
|
|
|
@ -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<Home> getUserHomes() {
|
||||
return homeData.findByUid(AuthUtil.getUserId());
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class SpaceController {
|
|||
/**
|
||||
* 我的空间列表
|
||||
*/
|
||||
@GetMapping("/spaces/{homeId}")
|
||||
@PostMapping("/spaces/{homeId}")
|
||||
public List<Space> getSpaces(@PathVariable("homeId") String homeId) {
|
||||
return spaceData.findByUidAndHomeIdOrderByCreateAtDesc(AuthUtil.getUserId(), homeId);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class SpaceDeviceController {
|
|||
/**
|
||||
* 我最近使用的设备列表
|
||||
*/
|
||||
@GetMapping(Constants.API_SPACE.RECENT_DEVICES)
|
||||
@PostMapping(Constants.API_SPACE.RECENT_DEVICES)
|
||||
public List<SpaceDeviceVo> getMyRecentDevices() {
|
||||
List<SpaceDevice> 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<SpaceDeviceVo> getCollectDevices() {
|
||||
Home home=homeData.findByUidAndCurrent(AuthUtil.getUserId(), true);
|
||||
List<SpaceDevice> 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<SpaceDeviceVo> getMyDevices(@PathVariable("spaceId") String spaceId) {
|
||||
String uid = AuthUtil.getUserId();
|
||||
List<SpaceDevice> spaceDevices;
|
||||
|
@ -141,7 +141,7 @@ public class SpaceDeviceController {
|
|||
/**
|
||||
* 获取用户所有设备列表
|
||||
*/
|
||||
@GetMapping("/{userId}/devices")
|
||||
@PostMapping("/{userId}/devices")
|
||||
public List<SpaceDeviceVo> getDevices(@PathVariable("userId") String userId) {
|
||||
List<SpaceDevice> 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<FindDeviceVo> 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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -48,7 +48,7 @@ public class UserInfoController {
|
|||
* 平台用户列表
|
||||
*/
|
||||
@SaCheckRole("iot_admin")
|
||||
@GetMapping("/platform/users")
|
||||
@PostMapping("/platform/users")
|
||||
public List<UserInfo> getPlatformUsers() {
|
||||
return userInfoData.findByType(UserInfo.USER_TYPE_PLATFORM);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class UserInfoController {
|
|||
/**
|
||||
* 客户端用户列表
|
||||
*/
|
||||
@GetMapping("/client/users")
|
||||
@PostMapping("/client/users")
|
||||
public List<UserInfo> clientUsers() {
|
||||
return userInfoData.findByTypeAndOwnerId(UserInfo.USER_TYPE_CLIENT, AuthUtil.getUserId());
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public class VirtualDeviceController {
|
|||
* 获取虚拟设备详情
|
||||
*/
|
||||
@ApiOperation("获取虚拟设备详情")
|
||||
@GetMapping("/getDetail")
|
||||
@PostMapping("/getDetail")
|
||||
public VirtualDevice detail(@Validated @RequestBody Request<String> bo) {
|
||||
return checkOwner(bo.getData());
|
||||
}
|
||||
|
|
|
@ -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<SysTenantVo> tenantList = tenantService.queryList(new SysTenantBo());
|
||||
List<TenantListVo> voList = tenantList.stream().map(t -> TenantListVo.builder()
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -50,7 +50,7 @@ public class VirtualManager {
|
|||
private IVirtualDeviceLogData virtualDeviceLogData;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
// @PostConstruct
|
||||
public void init() {
|
||||
new Timer().schedule(new TimerTask() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue