@ApiOperation(value = "export")
@PostMapping(value = "/export")
public void export(@RequestBody PageActivityMemberParam pageActivityMemberParam, HttpServletResponse response, HttpServletRequest request) throws IOException {
XSSFWorkbook workbook = new XSSFWorkbook();
// Create a sheet
XSSFSheet sheet = workbook.createSheet("Users");
// Create a header row
XSSFRow headerRow = sheet.createRow(0);
headerRow.createCell(0).setCellValue("序号");
// Get users from the repository
List<ExcelActivityMemberResp> excelActivityMemberRespList = activityMemberService.export(pageActivityMemberParam);
// Create a row for each user and fill in the data
for (int i = 0; i < excelActivityMemberRespList.size(); i++) {
ExcelActivityMemberResp excelActivityMemberResp = excelActivityMemberRespList.get(i);
XSSFRow row = sheet.createRow(i + 1);
row.createCell(0).setCellValue(excelActivityMemberResp.getId());
}
// Set the content type and header for the response
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename="+DateUtil.format(new Date(), PURE_DATETIME_MS_PATTERN)+".xlsx");
// Write the workbook to the response
workbook.write(response.getOutputStream());
}