IT'S DO
만들어진 변수 return
개념 정리 2022. 8. 2. 11:18

public List search(String keyword) { List eventList = eventRepository.findByTitleContaining(keyword); return eventList; } 만들어진 eventList를 return으로 보냄.

model 값 thymeleaf 값 담고 보내줄 때 사용
개발/Spring Boot 2022. 8. 2. 10:38

/** * 게시글 조회 */ 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)..

일단 확인 해야겠지만. 값 담을 때 쓰는 법
개발/JPA 2022. 8. 1. 10:55

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..

article thumbnail
JPA API 테스트
개발/API 2022. 7. 29. 19:54

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