Merge branch 'main' into yoon
This commit is contained in:
commit
b2e86d5350
@ -128,6 +128,8 @@ public class BoardController {
|
|||||||
@ParameterCheck
|
@ParameterCheck
|
||||||
@PostMapping("/{CMNBRDSEQ}/attachments")
|
@PostMapping("/{CMNBRDSEQ}/attachments")
|
||||||
public ApiResponse<String> uploadAttachment(@ReqMap MapDto map) {
|
public ApiResponse<String> uploadAttachment(@ReqMap MapDto map) {
|
||||||
|
//임시
|
||||||
|
map.put("CMNFLEREG", 1);
|
||||||
boardService.addAttachment(map);
|
boardService.addAttachment(map);
|
||||||
return ApiResponse.ok("첨부파일이 저장되었습니다.");
|
return ApiResponse.ok("첨부파일이 저장되었습니다.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.math.BigInteger;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -56,10 +57,13 @@ public class localbordService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addAttachment(MapDto map) {
|
public void addAttachment(MapDto map) {
|
||||||
|
String newFilename = UUID.randomUUID().toString();
|
||||||
|
map.put("CMNFLENAM", newFilename);
|
||||||
boardMapper.addAttachment(map);
|
boardMapper.addAttachment(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapDto getBoardDetail(Long boardId) {
|
public MapDto getBoardDetail(Long boardId) {
|
||||||
|
incrementViewCount(boardId);
|
||||||
MapDto boardDetail = boardMapper.selectBoardDetail(boardId);
|
MapDto boardDetail = boardMapper.selectBoardDetail(boardId);
|
||||||
if (boardDetail != null) {
|
if (boardDetail != null) {
|
||||||
enrichBoardDetail(boardDetail);
|
enrichBoardDetail(boardDetail);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user