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
+++ src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
@@ -63,6 +63,7 @@
                 .requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll() // swagger 진입 허용
                 .requestMatchers("/test/**").permitAll()
                 .requestMatchers("/studentInfo/**").permitAll() // 학생 정보 진입 허용(민수)
+                .requestMatchers("/board/**").permitAll() // 게시판 정보 진입 허용
                 .anyRequest().authenticated()); // 나머지 경로는 인증 필요
 
         // 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
+++ src/main/java/com/takensoft/ai_lms/lms/board/service/impl/BoardServiceImpl.java
@@ -1,5 +1,6 @@
 package com.takensoft.ai_lms.lms.board.service.impl;
 
+import com.takensoft.ai_lms.common.idgen.service.IdgenService;
 import com.takensoft.ai_lms.lms.board.dao.BoardDAO;
 import com.takensoft.ai_lms.lms.board.service.BoardService;
 import com.takensoft.ai_lms.lms.board.vo.BoardVO;
@@ -16,10 +17,13 @@
 
     private final BoardDAO boardDAO;
 
+    private final IdgenService boardIdgn;
 
     // 게시글 등록
     @Override
     public int insertBoard(BoardVO boardVO) throws Exception {
+        String boardId = boardIdgn.getNextStringId();
+        boardVO.setBbsId(boardId);
         return boardDAO.insertBoard(boardVO);
     }
     // 게시글 전체 조회
src/main/java/com/takensoft/ai_lms/lms/board/vo/BoardVO.java
--- 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 @@
     // 게시판 내용
     private String bbsContents;
     // 게시판 등록 날짜
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
-    private LocalDate bbsTime;
+    private String bbsTime;
     // 파일 관리 아이디
     private String fileManageId;
     // 반 아이디
src/main/resources/mybatis/mapper/lms/board-SQL.xml
--- src/main/resources/mybatis/mapper/lms/board-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/board-SQL.xml
@@ -58,7 +58,7 @@
         내 용 : 게시글 상세 조회
     -->
     <select id="findByBoardId" parameterType="BoardVO" resultMap="boardMap">
-        SELECT bbs_id, bbs_ttl, bbs_cls, bbs_cnt, file_mng_id
+        SELECT bbs_id, bbs_ttl, bbs_cls, bbs_cnt,bbs_tm, file_mng_id
         FROM board
         WHERE bbs_id = #{bbsId}
         ORDER BY bbs_id DESC
Add a comment
List