게시판 로그링정보 수정
This commit is contained in:
parent
8fa323414a
commit
bbb1bc4eae
@ -29,6 +29,7 @@ import io.company.localhost.common.dto.ApiResponse;
|
||||
import io.company.localhost.common.dto.MapDto;
|
||||
import io.company.localhost.service.commoncodService;
|
||||
import io.company.localhost.service.localbordService;
|
||||
import io.company.localhost.utils.AuthUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -55,7 +56,7 @@ public class BoardController {
|
||||
|
||||
/**
|
||||
* 자유/익명 게시판 목록 조회
|
||||
* @ReqMap map 요청 파라미터 (page, searchKeyword, orderBy)
|
||||
* @ReqMap map 요청 파라미터 (page, searchKeyword, orderBy, size)
|
||||
* @return 페이징된 자유/익명 게시판 목록
|
||||
*/
|
||||
@Member
|
||||
@ -75,8 +76,8 @@ public class BoardController {
|
||||
@ParameterCheck
|
||||
@PostMapping
|
||||
public ApiResponse<BigInteger> createBoard(@ReqMap MapDto map) {
|
||||
//임시
|
||||
map.put("MEMBERSEQ", 1);
|
||||
Long userId = AuthUtil.getUser().getId();
|
||||
map.put("MEMBERSEQ", userId);
|
||||
return ApiResponse.ok(boardService.createBoard(map));
|
||||
}
|
||||
|
||||
@ -130,8 +131,8 @@ public class BoardController {
|
||||
@ParameterCheck
|
||||
@PostMapping("/{CMNBRDSEQ}/attachments")
|
||||
public ApiResponse<String> uploadAttachment(@ReqMap MapDto map) {
|
||||
//임시
|
||||
map.put("CMNFLEREG", 1);
|
||||
Long userId = AuthUtil.getUser().getId();
|
||||
map.put("CMNFLEREG", userId);
|
||||
boardService.addAttachment(map);
|
||||
return ApiResponse.ok("첨부파일이 저장되었습니다.");
|
||||
}
|
||||
@ -145,8 +146,8 @@ public class BoardController {
|
||||
@ParameterCheck
|
||||
@PostMapping("/{LOCBRDSEQ}/{LOCCMTSEQ}/reaction")
|
||||
public ApiResponse<String> reactToBoard(@ReqMap MapDto map) {
|
||||
//임시
|
||||
map.put("MEMBERSEQ", 1);
|
||||
Long userId = AuthUtil.getUser().getId();
|
||||
map.put("MEMBERSEQ", userId);
|
||||
boardService.reactToBoard(map);
|
||||
return ApiResponse.ok("반응이 성공적으로 처리되었습니다.");
|
||||
}
|
||||
@ -173,8 +174,8 @@ public class BoardController {
|
||||
@ParameterCheck
|
||||
@PostMapping("/{LOCBRDSEQ}/comment")
|
||||
public ApiResponse<String> addCommentOrReply(@ReqMap MapDto map) {
|
||||
//임시
|
||||
map.put("MEMBERSEQ", 1);
|
||||
Long userId = AuthUtil.getUser().getId();
|
||||
map.put("MEMBERSEQ", userId);
|
||||
boardService.addCommentOrReply(map);
|
||||
return ApiResponse.ok("댓글 또는 대댓글이 작성되었습니다.");
|
||||
}
|
||||
|
||||
@ -5,12 +5,14 @@
|
||||
<!-- 공지사항 조회 -->
|
||||
<select id="getNotices" resultType="io.company.localhost.common.dto.MapDto">
|
||||
SELECT
|
||||
LOCBRDSEQ AS id,
|
||||
LOCBRDTTL AS title,
|
||||
LOCBRDCON AS content,
|
||||
LOCBRDUDT AS date,
|
||||
LOCBRDCNT AS cnt
|
||||
FROM localbord
|
||||
b.LOCBRDSEQ AS id,
|
||||
b.LOCBRDTTL AS title,
|
||||
b.LOCBRDCON AS content,
|
||||
b.LOCBRDUDT AS date,
|
||||
b.LOCBRDCNT AS cnt,
|
||||
m.MEMBERNAM AS author
|
||||
FROM localbord b
|
||||
LEFT JOIN netmember m ON b.MEMBERSEQ = m.MEMBERSEQ
|
||||
WHERE LOCBRDTYP = '300103'
|
||||
<if test="searchKeyword != null and searchKeyword != ''">
|
||||
AND LOCBRDTTL LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||
@ -18,25 +20,28 @@
|
||||
ORDER BY LOCBRDUDT DESC
|
||||
</select>
|
||||
|
||||
<!-- 자유/익명 게시판 조회 -->
|
||||
<!-- 자유/익명 게시판 조회 (작성자 이름 포함) -->
|
||||
<select id="getGeneralPosts" resultType="io.company.localhost.common.dto.MapDto">
|
||||
SELECT
|
||||
LOCBRDSEQ AS id,
|
||||
LOCBRDTTL AS title,
|
||||
LOCBRDCON AS content,
|
||||
LOCBRDUDT AS date,
|
||||
LOCBRDCNT AS cnt
|
||||
FROM localbord
|
||||
WHERE LOCBRDTYP IN ('300101', '300102')
|
||||
b.LOCBRDSEQ AS id,
|
||||
b.LOCBRDTTL AS title,
|
||||
b.LOCBRDCON AS content,
|
||||
b.LOCBRDUDT AS date,
|
||||
b.LOCBRDCNT AS cnt,
|
||||
m.MEMBERNAM AS author
|
||||
FROM localbord b
|
||||
LEFT JOIN netmember m ON b.MEMBERSEQ = m.MEMBERSEQ
|
||||
WHERE b.LOCBRDTYP IN ('300101', '300102')
|
||||
<if test="searchKeyword != null and searchKeyword != ''">
|
||||
AND LOCBRDTTL LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||
AND b.LOCBRDTTL LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||
</if>
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="orderBy == 'date'"> LOCBRDUDT DESC </when>
|
||||
<when test="orderBy == 'views'"> LOCBRDCNT DESC </when>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="orderBy == 'date'"> b.LOCBRDUDT DESC </when>
|
||||
<when test="orderBy == 'views'"> b.LOCBRDCNT DESC </when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 조회수 증가 -->
|
||||
<update id="incrementViewCount">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user