|
@@ -1,10 +1,6 @@
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
|
|
-import cn.com.qmth.examcloud.service.core.dto.OrgDto;
|
|
|
|
-import cn.com.qmth.examcloud.service.core.util.ExportUtils;
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
-
|
|
|
|
|
|
+import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -13,6 +9,10 @@ import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -30,16 +30,17 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
import cn.com.qmth.examcloud.common.util.excel.ExcelError;
|
|
import cn.com.qmth.examcloud.common.util.excel.ExcelError;
|
|
|
|
+import cn.com.qmth.examcloud.service.core.dto.OrgDto;
|
|
import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
import cn.com.qmth.examcloud.service.core.entity.Org;
|
|
import cn.com.qmth.examcloud.service.core.repo.OrgRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.OrgRepo;
|
|
import cn.com.qmth.examcloud.service.core.service.OrgService;
|
|
import cn.com.qmth.examcloud.service.core.service.OrgService;
|
|
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
|
|
|
-
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.service.core.util.ExportUtils;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 机构服务API
|
|
* 机构服务API
|
|
@@ -271,4 +272,17 @@ public class OrgApi {
|
|
public ResponseEntity getAllPrintOrg() {
|
|
public ResponseEntity getAllPrintOrg() {
|
|
return new ResponseEntity(orgRepo.findAllPrintByParentId(0L), HttpStatus.OK);
|
|
return new ResponseEntity(orgRepo.findAllPrintByParentId(0L), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "导入logo", notes = "导入logo")
|
|
|
|
+ @PostMapping("/importLogo/{id}")
|
|
|
|
+ public ResponseEntity importLogo(@PathVariable Long id, HttpServletRequest request,
|
|
|
|
+ @RequestParam CommonsMultipartFile file) {
|
|
|
|
+ try {
|
|
|
|
+ FileUtils.copyInputStreamToFile(file.getInputStream(), new File("D:/Temp/fuck.jpg"));
|
|
|
|
+ return new ResponseEntity("", HttpStatus.OK);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|