|
@@ -17,6 +17,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.Valid;
|
|
import jakarta.validation.Valid;
|
|
|
|
|
+import jakarta.validation.constraints.Size;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -60,6 +61,15 @@ public class Demo01ContactController {
|
|
|
return success(true);
|
|
return success(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @DeleteMapping("/delete-batch")
|
|
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
|
|
+ @Operation(summary = "批量删除示例联系人")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo01-contact:delete')")
|
|
|
|
|
+ public CommonResult<Boolean> deleteDemo01Contact(@RequestParam("ids") @Size(max = 100, message = "最多允许100个") List<Long> ids) {
|
|
|
|
|
+ demo01ContactService.deleteDemo01ContactByIds(ids);
|
|
|
|
|
+ return success(true);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
@Operation(summary = "获得示例联系人")
|
|
@Operation(summary = "获得示例联系人")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
@@ -82,12 +92,12 @@ public class Demo01ContactController {
|
|
|
@PreAuthorize("@ss.hasPermission('infra:demo01-contact:export')")
|
|
@PreAuthorize("@ss.hasPermission('infra:demo01-contact:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
public void exportDemo01ContactExcel(@Valid Demo01ContactPageReqVO pageReqVO,
|
|
public void exportDemo01ContactExcel(@Valid Demo01ContactPageReqVO pageReqVO,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
|
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
List<Demo01ContactDO> list = demo01ContactService.getDemo01ContactPage(pageReqVO).getList();
|
|
List<Demo01ContactDO> list = demo01ContactService.getDemo01ContactPage(pageReqVO).getList();
|
|
|
// 导出 Excel
|
|
// 导出 Excel
|
|
|
ExcelUtils.write(response, "示例联系人.xls", "数据", Demo01ContactRespVO.class,
|
|
ExcelUtils.write(response, "示例联系人.xls", "数据", Demo01ContactRespVO.class,
|
|
|
- BeanUtils.toBean(list, Demo01ContactRespVO.class));
|
|
|
|
|
|
|
+ BeanUtils.toBean(list, Demo01ContactRespVO.class));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|