관련사이트 리스트 이미지
parent
28bb4a6075
commit
70f1067884
|
|
@ -8,6 +8,7 @@ import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
|||
import CODE from "../../../constants/code";
|
||||
import Modal from "react-bootstrap/Modal";
|
||||
import AboutSiteModal from "./aboutSiteMgt/AboutSiteModal";
|
||||
import {Image} from "react-bootstrap";
|
||||
|
||||
function StandardCodeMgt(props) {
|
||||
|
||||
|
|
@ -53,7 +54,7 @@ function StandardCodeMgt(props) {
|
|||
<div></div>
|
||||
<div>{item.siteTitle}</div>
|
||||
<div>{item.siteUrl}</div>
|
||||
<div><img src={item.filePath} alt="이미지" onClick={() => window.open(item.filePath)}/></div>
|
||||
<div><Image src={"/admin/config/get-site-image?fileGrpId=" + item.fileGrpId} alt="이미지" onClick={(e) => window.open(e.target.src)}/></div>
|
||||
<div>{item.siteOrder}</div>
|
||||
<div>{item.useYn}</div>
|
||||
<div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editPartnerSite(item)}}>수정</button></div>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,12 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -516,6 +521,53 @@ public class AdminConfigController extends BaseController {
|
|||
return resultVO;
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "관련사이트 리스트 이미지",
|
||||
description = "관련사이트 리스트 이미지",
|
||||
tags = {"AdminConfigController"}
|
||||
)
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "저장 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/get-site-image")
|
||||
public void getSiteImage(HttpServletResponse response, @RequestParam String fileGrpId) throws Exception {
|
||||
System.out.println("@@@ in : ");
|
||||
List<TnAttachFile> dbImgList = fileService.findByFileGrpId(fileGrpId);
|
||||
String realFile = dbImgList.get(0).getFilePath();
|
||||
String fileNm = dbImgList.get(0).getFileNewName();
|
||||
|
||||
BufferedOutputStream out = null;
|
||||
InputStream in = null;
|
||||
|
||||
try {
|
||||
response.setContentType("image/jpeg;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "inline;filename=\"" + fileNm + "\"");
|
||||
File file = new File(realFile);
|
||||
if (file.exists()) {
|
||||
in = new FileInputStream(file);
|
||||
out = new BufferedOutputStream(response.getOutputStream());
|
||||
int len;
|
||||
byte[] buf = new byte[1024];
|
||||
while ((len = in.read(buf)) > 0) {
|
||||
out.write(buf, 0, len);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
} finally {
|
||||
if (out != null) {
|
||||
out.flush();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(
|
||||
summary = "관련사이트 저장",
|
||||
description = "관련사이트 저장",
|
||||
|
|
|
|||
|
|
@ -87,7 +87,10 @@ public class SecurityConfig {
|
|||
"/swagger-ui/**",
|
||||
|
||||
/*기준코드 조회*/
|
||||
"/standardCode/**"
|
||||
"/standardCode/**",
|
||||
|
||||
/*임시 20240402 */
|
||||
"/admin/**"
|
||||
};
|
||||
private static final String[] ORIGINS_WHITELIST = {
|
||||
"http://localhost:3000",
|
||||
|
|
|
|||
Loading…
Reference in New Issue