mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
update 优化响应信息主体,避免 string 类型的 data 数据返回到 msg 字段中
This commit is contained in:
parent
1bc238d428
commit
74c7d2c563
@ -73,7 +73,7 @@ public class TestDemoController extends BaseController {
|
|||||||
@Log(title = "测试单表", businessType = BusinessType.IMPORT)
|
@Log(title = "测试单表", businessType = BusinessType.IMPORT)
|
||||||
@SaCheckPermission("demo:demo:import")
|
@SaCheckPermission("demo:demo:import")
|
||||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public R<Void> importData(@RequestPart("file") MultipartFile file) throws Exception {
|
public R<String> importData(@RequestPart("file") MultipartFile file) throws Exception {
|
||||||
ExcelResult<TestDemoImportVo> excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true);
|
ExcelResult<TestDemoImportVo> excelResult = ExcelUtil.importExcel(file.getInputStream(), TestDemoImportVo.class, true);
|
||||||
List<TestDemo> list = MapstructUtils.convert(excelResult.getList(), TestDemo.class);
|
List<TestDemo> list = MapstructUtils.convert(excelResult.getList(), TestDemo.class);
|
||||||
testDemoService.saveBatch(list);
|
testDemoService.saveBatch(list);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class TestI18nController {
|
|||||||
* @param code 国际化code
|
* @param code 国际化code
|
||||||
*/
|
*/
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public R<Void> get(String code) {
|
public R<String> get(String code) {
|
||||||
return R.ok(MessageUtils.message(code));
|
return R.ok(MessageUtils.message(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public class TestI18nController {
|
|||||||
* 测试使用 not.null
|
* 测试使用 not.null
|
||||||
*/
|
*/
|
||||||
@GetMapping("/test1")
|
@GetMapping("/test1")
|
||||||
public R<Void> test1(@NotBlank(message = "{not.null}") String str) {
|
public R<String> test1(@NotBlank(message = "{not.null}") String str) {
|
||||||
return R.ok(str);
|
return R.ok(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ public class SysUserController extends BaseController {
|
|||||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||||
@SaCheckPermission("system:user:import")
|
@SaCheckPermission("system:user:import")
|
||||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
public R<String> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception {
|
||||||
ExcelResult<SysUserImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport));
|
ExcelResult<SysUserImportVo> result = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class, new SysUserImportListener(updateSupport));
|
||||||
return R.ok(result.getAnalysis());
|
return R.ok(result.getAnalysis());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user