update:将所有请求改为post

V0.5.x
tangfudong 2023-06-08 11:14:18 +08:00
parent 165449fcb8
commit b00e57cf33
12 changed files with 34 additions and 34 deletions

View File

@ -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

View File

@ -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);

View File

@ -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}));

View File

@ -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) {

View File

@ -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);
}

View File

@ -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);

View File

@ -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();

View File

@ -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());
}

View File

@ -95,7 +95,7 @@ public class VirtualDeviceController {
*
*/
@ApiOperation("获取虚拟设备详情")
@GetMapping("/getDetail")
@PostMapping("/getDetail")
public VirtualDevice detail(@Validated @RequestBody Request<String> bo) {
return checkOwner(bo.getData());
}

View File

@ -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()

View File

@ -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();

View File

@ -50,7 +50,7 @@ public class VirtualManager {
private IVirtualDeviceLogData virtualDeviceLogData;
@PostConstruct
// @PostConstruct
public void init() {
new Timer().schedule(new TimerTask() {
@Override