public List search(String keyword) { List eventList = eventRepository.findByTitleContaining(keyword); return eventList; } 만들어진 eventList를 return으로 보냄.
/** * 게시글 조회 */ function findBoard() { const id = /*[[ ${id} ]]*/; fetch(`/api/events/${id}`).then(response => { if (!response.ok) { throw new Error('Request failed...'); } return response.json(); }).then(json => { console.table(json); json.createdDate = moment(json.createdDate).format('YYYY-MM-DD HH:mm:ss'); Object.keys(json).forEach(key => { const elem = document.getElementById(key); if (elem)..
EventResponseDto.java private User user; public EventResponseDto(Event entity) { this.user = entity.getUser(); } EventServiceImpl @Transactional public Long save(final EventRequestDto params, User user) { params.setUser(user); Event entity = eventRepository.save(params.toEntity()); return entity.getId(); } EventApiController @PostMapping("/events") public Long save(@RequestBody final EventReques..

POST -> INSERT가 될 것 http://localhost:8080/api/boards GET -> LIST가 될 것 http://localhost:8080/api/boards PATCH -> UPDATE가 될 것 수정됨.