본문 바로가기

분류 전체보기187

53. 스터디 설정 - 배너 배너 화면 요청을 처리하는 핸들러 생성 package me.weekbelt.studyolle.study; @RequiredArgsConstructor @RequestMapping("/study/{path}/settings") @Controller public class StudySettingsController { // ...... @GetMapping("/banner") public String studyImageForm(@CurrentAccount Account account, @PathVariable String path, Model model) { Study study = studyService.getStudyToUpdate(account, path); model.addAttribute(accou.. 2020. 4. 24.
52. 스터디 설정 - 소개 수정 수정전 StudyController와 StudyService 리팩토링 package me.weekbelt.studyolle.study; @RequiredArgsConstructor @Controller public class StudyController { @GetMapping("/study/{path}") public String viewStudy(@CurrentAccount Account account, @PathVariable String path, Model model) { Study study = studyService.getStudy(path); // 추가 model.addAttribute(account); model.addAttribute(study); // 수정 return "study/v.. 2020. 4. 24.
51. 스터디 폼 & 개설 & 멤버 조회 테스트 package me.weekbelt.studyolle.study; @RequiredArgsConstructor @Transactional @SpringBootTest @AutoConfigureMockMvc class StudyControllerTest { @Autowired MockMvc mockMvc; @Autowired StudyService studyService; @Autowired StudyRepository studyRepository; @Autowired AccountRepository accountRepository; @AfterEach void afterEach() { accountRepository.deleteAll(); } @Test @WithAccount("joohyuk") @Dis.. 2020. 4. 24.
50. 스터디 구성원 조회 타임리프 fragment에 리스트와 true/false 전달하기 타임리프 fragment ... 스터디 멤버를 조회하는 핸들러 구현 package me.weekbelt.studyolle.study; @RequiredArgsConstructor @Controller public class StudyController { // ....... @GetMapping("/study/{path}/members") public String viewStudyMember(@CurrentAccount Account account, @PathVariable String path, Model model) { model.addAttribute(account); model.addAttribute(studyRepository.fi.. 2020. 4. 23.