본문 바로가기

스프링과 JPA 기반 웹 어플리케이션 개발85

37. 관심 주제 자동완성 기존의 태그 정보 자동완성 목록으로 제공하는 기능 Tagify의 whitelist를 사용한다. https://yaireo.github.io/tagify/#section-manual-suggestions Tagify - demo #textarea In this example, the field is pre-ocupied with 3 tags, and last tag is not included in the whitelist, and will be removed because the enforceWhitelist option flag is set to true HTML The Matrix, Pulp Fiction, Mad Max JAVASCRIPT The Matrix, Pulp F yaireo.github... 2020. 4. 22.
36. 관심 주제 삭제 관심 주제 삭제 관련 핸들러 작성 package me.weekbelt.studyolle.settings; @RequiredArgsConstructor @Controller public class SettingsController { // 기존 코드 ......... @ResponseBody @PostMapping("/settings/tags/remove") public ResponseEntity removeTag(@CurrentUser Account account, @RequestBody TagForm tagForm) { String title = tagForm.getTagTitle(); Tag tag = tagRepository.findByTitle(title).get(); if (tag == null.. 2020. 4. 22.
35. 관심 주제 조회 관심 주제를 등록한 이후 다른 탭으로 이동후 다시 돌아오면 화면에 등록된 관심주제가 나타나지 않는다. 그래서 관심주제를 나타내기 위한 과정을 진행 한다. 관심 주제 화면 요청시 기존에 관심 주제로 등록되었던 데이터를 조회 시키기 위한 로직 추가 package me.weekbelt.studyolle.settings; @RequiredArgsConstructor @Controller public class SettingsController { // 기존 코드 ..... @GetMapping("/settings/tags") public String updateTags(@CurrentUser Account account, Model model) { // 기존 코드 .... Set tags = accountSer.. 2020. 4. 22.
34. 관심주제 등록하기 SQL 확인을 위한 application.properties설정 # 기존 코드 .............. # 개발할 때에만 create-drop 또는 update를 사용하고 운영 환경에서는 validate를 사용합니다. spring.jpa.hibernate.ddl-auto=create-drop # 개발시 SQL 로깅을 하여 어떤 값으로 어떤 SQL이 실행되는지 확인합니다. spring.jpa.properties.hibernate.format_sql=true logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE 프론트엔드 라이브러리 Tagify npm install @yair.. 2020. 4. 22.