PsHooN7979
07-26
240726 박세훈 게시판 아이디 자동 추가 기능 및 timestamp 수정
@1f19e7f559cc9f48fcb25939dc482937cc1b28c6
--- src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
+++ src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
... | ... | @@ -63,6 +63,7 @@ |
63 | 63 |
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll() // swagger 진입 허용 |
64 | 64 |
.requestMatchers("/test/**").permitAll() |
65 | 65 |
.requestMatchers("/studentInfo/**").permitAll() // 학생 정보 진입 허용(민수) |
66 |
+ .requestMatchers("/board/**").permitAll() // 게시판 정보 진입 허용 |
|
66 | 67 |
.anyRequest().authenticated()); // 나머지 경로는 인증 필요 |
67 | 68 |
|
68 | 69 |
// jwt 필터 처리 적용 |
--- src/main/java/com/takensoft/ai_lms/lms/board/service/impl/BoardServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/board/service/impl/BoardServiceImpl.java
... | ... | @@ -1,5 +1,6 @@ |
1 | 1 |
package com.takensoft.ai_lms.lms.board.service.impl; |
2 | 2 |
|
3 |
+import com.takensoft.ai_lms.common.idgen.service.IdgenService; |
|
3 | 4 |
import com.takensoft.ai_lms.lms.board.dao.BoardDAO; |
4 | 5 |
import com.takensoft.ai_lms.lms.board.service.BoardService; |
5 | 6 |
import com.takensoft.ai_lms.lms.board.vo.BoardVO; |
... | ... | @@ -16,10 +17,13 @@ |
16 | 17 |
|
17 | 18 |
private final BoardDAO boardDAO; |
18 | 19 |
|
20 |
+ private final IdgenService boardIdgn; |
|
19 | 21 |
|
20 | 22 |
// 게시글 등록 |
21 | 23 |
@Override |
22 | 24 |
public int insertBoard(BoardVO boardVO) throws Exception { |
25 |
+ String boardId = boardIdgn.getNextStringId(); |
|
26 |
+ boardVO.setBbsId(boardId); |
|
23 | 27 |
return boardDAO.insertBoard(boardVO); |
24 | 28 |
} |
25 | 29 |
// 게시글 전체 조회 |
--- src/main/java/com/takensoft/ai_lms/lms/board/vo/BoardVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/board/vo/BoardVO.java
... | ... | @@ -38,9 +38,7 @@ |
38 | 38 |
// 게시판 내용 |
39 | 39 |
private String bbsContents; |
40 | 40 |
// 게시판 등록 날짜 |
41 |
- @DateTimeFormat(pattern = "yyyy-MM-dd") |
|
42 |
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") |
|
43 |
- private LocalDate bbsTime; |
|
41 |
+ private String bbsTime; |
|
44 | 42 |
// 파일 관리 아이디 |
45 | 43 |
private String fileManageId; |
46 | 44 |
// 반 아이디 |
--- src/main/resources/mybatis/mapper/lms/board-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/board-SQL.xml
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 |
내 용 : 게시글 상세 조회 |
59 | 59 |
--> |
60 | 60 |
<select id="findByBoardId" parameterType="BoardVO" resultMap="boardMap"> |
61 |
- SELECT bbs_id, bbs_ttl, bbs_cls, bbs_cnt, file_mng_id |
|
61 |
+ SELECT bbs_id, bbs_ttl, bbs_cls, bbs_cnt,bbs_tm, file_mng_id |
|
62 | 62 |
FROM board |
63 | 63 |
WHERE bbs_id = #{bbsId} |
64 | 64 |
ORDER BY bbs_id DESC |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?