Commit 667bbde9 authored by Quxl's avatar Quxl

x

parent c3f7be1a
package com.egolm.film.api.web; package com.egolm.film.api.web;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.DateUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.film.api.service.AdminTokenService; import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.ExportService; import com.egolm.film.api.service.ExportService;
...@@ -196,13 +189,4 @@ public class FilmController { ...@@ -196,13 +189,4 @@ public class FilmController {
return Rjx.jsonOk().set("id", filmBase.getId()); return Rjx.jsonOk().set("id", filmBase.getId());
} }
@Transactional
@GetMapping("exportExcel")
@ApiOperation("导出Excel")
public void exportExcel(HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("影片列表[" + DateUtil.format(new Date(), "yyMMdd-HHmmss") + "].xls", "UTF-8"));
exportService.export(response.getOutputStream());
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment