메인 게시판 로직 수정

This commit is contained in:
dyhj625 2025-04-01 16:13:04 +09:00
parent dd31e08c4f
commit dcb996f50b
2 changed files with 17 additions and 1 deletions

View File

@ -74,6 +74,19 @@ public class BoardController {
@ParameterCheck
@GetMapping("/notices")
public ApiResponse<List<MapDto>> getNotices(@ReqMap MapDto map) {
// size를 안전하게 Integer로 변환하여 MapDto에 다시 넣기
Object sizeObj = map.get("size");
Integer size = null;
if (sizeObj instanceof String) {
size = Integer.parseInt((String) sizeObj);
}else {
size = null;
}
map.put("size", size);
return ApiResponse.ok(boardService.selectNotices(map));
}

View File

@ -15,6 +15,9 @@
LEFT JOIN netmember m ON b.MEMBERSEQ = m.MEMBERSEQ
WHERE LOCBRDTYP = '300103'
ORDER BY LOCBRDUDT DESC
<if test="size != null">
LIMIT #{size}
</if>
</select>
<!-- 자유/익명 게시판 조회 (작성자 이름 포함) -->