|
|
@ -1,10 +1,17 @@ |
|
|
|
package com.inscloudtech.functional.controller; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.inscloudtech.common.annotation.Log; |
|
|
|
import com.inscloudtech.common.core.domain.PageQuery; |
|
|
|
import com.inscloudtech.common.core.domain.R; |
|
|
|
import com.inscloudtech.common.core.page.TableDataInfo; |
|
|
|
import com.inscloudtech.common.encrypt.annotation.ApiEncrypt; |
|
|
|
import com.inscloudtech.common.enums.BusinessType; |
|
|
|
import com.inscloudtech.functional.domain.CpuInfo; |
|
|
|
import com.inscloudtech.functional.domain.TestDemoEncrypt; |
|
|
|
import com.inscloudtech.functional.domain.vo.TestDemoBo; |
|
|
|
import com.inscloudtech.functional.mapper.TestDemoEncryptMapper; |
|
|
@ -33,6 +40,29 @@ public class SensitiveDbController { |
|
|
|
@Value("${mybatis-encryptor.enable}") |
|
|
|
private Boolean encryptEnable; |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页查询 |
|
|
|
* @param |
|
|
|
* @param |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@ApiEncrypt(response = true) |
|
|
|
@GetMapping("/testDemoEncrypt/page" ) |
|
|
|
public TableDataInfo<TestDemoEncrypt> testDemoEncryptPage(PageQuery pageQuery, TestDemoBo bo) { |
|
|
|
Page page = new Page(); |
|
|
|
page.setSize(pageQuery.getPageSize() == null?200:pageQuery.getPageSize()); |
|
|
|
page.setCurrent(pageQuery.getPageNum() == null?1:pageQuery.getPageNum()); |
|
|
|
TestDemoEncrypt demoEncrypt = new TestDemoEncrypt(); |
|
|
|
QueryWrapper<TestDemoEncrypt> query = Wrappers.query(demoEncrypt); |
|
|
|
|
|
|
|
Page result = mapper.selectPage(page, query); |
|
|
|
TableDataInfo dataInfo = new TableDataInfo(); |
|
|
|
dataInfo.setTotal(result.getTotal()); |
|
|
|
dataInfo.setRows(result.getRecords()); |
|
|
|
return dataInfo; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 加密和解密模块测试 |
|
|
|
*/ |
|
|
@ -54,6 +84,18 @@ public class SensitiveDbController { |
|
|
|
return R.ok(map); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除加密数据 |
|
|
|
*/ |
|
|
|
@ApiEncrypt(response = true) |
|
|
|
@Log(title = "加密和解密模块测试", businessType = BusinessType.DELETE) |
|
|
|
@PostMapping("/delEncrypt") |
|
|
|
public R<Void> delEncrypt(@RequestBody TestDemoBo bo) { |
|
|
|
mapper.deleteBatchIds(bo.getIds()); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|