BoardServiceImpl
페이지 정보
본문
package web.service;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Service;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import web.domain.Board;
import web.dto.BoardDTO;
import web.repository.BoardRepository;
@Service
@Log4j2
@RequiredArgsConstructor
@Transactional
public class BoardServiceImpl implements BoardService {
private final ModelMapper modelMapper;
private final BoardRepository boardRepository;
@Override
public Long register(BoardDTO boardDTO) {
Board board = modelMapper.map(boardDTO, Board.class);
Long bno = boardRepository.save(board).getBno();
return bno;
}
}
- 이전글BoardService 24.06.17
- 다음글BoardServiceTests 24.06.17
댓글목록
등록된 댓글이 없습니다.