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