|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.context.AnalysisContext;
|
|
|
import com.alibaba.excel.event.AnalysisEventListener;
|
|
|
+import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.SoraCodeMapper;
|
|
|
@@ -12,6 +13,7 @@ import com.cyksj.model.excel.ExcelSoraCodeData;
|
|
|
import com.cyksj.model.request.SoraCodeAddReq;
|
|
|
import com.cyksj.model.request.SoraCodeUpdateReq;
|
|
|
import com.cyksj.service.sora.SoraCodeService;
|
|
|
+import com.cyksj.web.util.EasyExcelUtils;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
|
|
|
/**
|
|
|
@@ -81,6 +84,14 @@ public class SoraCodeController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量导入Sora邀请码模板
|
|
|
+ */
|
|
|
+ @PostMapping("/import/template")
|
|
|
+ public void importTemplate(HttpServletResponse response) throws IOException {
|
|
|
+ EasyExcelUtils.createTemplateExcel(response, ExcelSoraCodeData.class, "Sora邀请码导入模板", "Sora邀请码导入模板", ExcelTypeEnum.XLSX, null);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 批量导入Sora邀请码
|
|
|
*/
|