자료실 파일첨부 화면에 추가(기능X)

master
유지인 2025-07-16 09:06:44 +09:00
parent 026db9d758
commit 4fb99fdb08
2 changed files with 7 additions and 7 deletions

View File

@ -199,8 +199,8 @@ public class BoardRestController extends BaseController {
@RequestParam("boardContent") String content,
// Using @RequestParam(value = "parentPostId", required = false) for optionality.
// If it comes as an empty string, it will be null.
@RequestParam(value = "parentPostId", required = false) Long parentPostId, // This is good
@RequestParam("files") List<MultipartFile> files
@RequestParam(value = "parentPostId", required = false) Long parentPostId/*, // This is good
@RequestParam("files") List<MultipartFile> files*/
) {
Post newPost = new Post();
newPost.setBoardCategoryId(boardCategoryId);
@ -242,7 +242,7 @@ public class BoardRestController extends BaseController {
Post createdPost = postService.createPost(newPost);
// 게시글 등록 성공시 파일 서버 저장 및 테이블 insert 처리
Date nowDate = new Date();
/* Date nowDate = new Date();
String strNowYyyy = new SimpleDateFormat("yyyy").format(nowDate);
String strNowMm = new SimpleDateFormat("MM").format(nowDate);
String fileUploadPath = "uploads/files/" + strNowYyyy + "/" + strNowMm + "/";
@ -274,7 +274,7 @@ public class BoardRestController extends BaseController {
if (tbFileList.size()>0) {
attachService.insertAttachList(tbFileList);
}
}
}*/
// 생성된 Post 객체 반환 (클라이언트에게 성공 여부 및 생성된 게시글 정보 전달)
return createdPost;

View File

@ -269,9 +269,9 @@ function addPost(){
if (parentPostId !== null && parentPostId !== "" && parentPostId !== "null") {
formData.append("parentPostId", parentPostId);
}
$.each(fileList, function (i, file) {
formData.append("files", file);
});
// $.each(fileList, function (i, file) {
// formData.append("files", file);
// });
$.ajax({
url : "/sgis/portal/board/new.do",