|
|
@ -4,7 +4,6 @@ import com.kiisoo.ic.common.BaseController;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
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.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@ -32,7 +31,7 @@ public class FileController extends BaseController {
|
|
|
|
if (!targetPath.exists()) {
|
|
|
|
if (!targetPath.exists()) {
|
|
|
|
boolean state = targetPath.mkdirs();
|
|
|
|
boolean state = targetPath.mkdirs();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FileOutputStream out = new FileOutputStream("upload" + fileName);
|
|
|
|
FileOutputStream out = new FileOutputStream("upload/" + fileName);
|
|
|
|
out.write(file.getBytes());
|
|
|
|
out.write(file.getBytes());
|
|
|
|
out.flush();
|
|
|
|
out.flush();
|
|
|
|
out.close();
|
|
|
|
out.close();
|
|
|
@ -40,7 +39,7 @@ public class FileController extends BaseController {
|
|
|
|
log.error("上传出错", e);
|
|
|
|
log.error("上传出错", e);
|
|
|
|
return fail();
|
|
|
|
return fail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return data("/upload" + fileName);
|
|
|
|
return data("/upload/" + fileName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private String renameToUUID(String filename) {
|
|
|
|
private String renameToUUID(String filename) {
|
|
|
|