-
Notifications
You must be signed in to change notification settings - Fork 0
[FIX] 게시글 작성 및 메인페이지 수정, 도메인 변수명 수정 #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...g/controller/follow/FollowController.java → ...e/FixLog/controller/FollowController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/com/example/FixLog/controller/MemberController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| //package com.example.fixlog.controller; | ||
| // | ||
| // | ||
| //import com.example.fixlog.dto.Response; | ||
| //import com.example.fixlog.dto.member.SignupRequestDto; | ||
| //import com.example.fixlog.dto.member.DuplicateCheckResponseDto; | ||
| //import com.example.fixlog.service.MemberService; | ||
| //import lombok.RequiredArgsConstructor; | ||
| //import org.springframework.http.ResponseEntity; | ||
| //import org.springframework.web.bind.annotation.*; | ||
| // | ||
| //@RestController | ||
| //@RequestMapping("/api/members") | ||
| //@RequiredArgsConstructor | ||
| //public class MemberController { | ||
| // | ||
| // private final MemberService memberService; | ||
| // | ||
| // @PostMapping("/signup") | ||
| // public ResponseEntity<Response<String>> signup(@RequestBody SignupRequestDto request) { | ||
| // memberService.signup(request); | ||
| // return ResponseEntity.ok(Response.success("회원가입이 완료되었습니다.", null)); | ||
| // } | ||
| // | ||
| // @GetMapping("/check-email") | ||
| // public ResponseEntity<Response<DuplicateCheckResponseDto>> checkEmail(@RequestParam String email) { | ||
| // boolean exists = memberService.isEmailDuplicated(email); | ||
| // String msg = exists ? "이미 사용 중인 이메일입니다." : "사용 가능한 이메일입니다."; | ||
| // return ResponseEntity.ok(Response.success(msg, new DuplicateCheckResponseDto(exists))); | ||
| // } | ||
| // | ||
| // @GetMapping("/check-nickname") | ||
| // public ResponseEntity<Response<DuplicateCheckResponseDto>> checkNickname(@RequestParam String nickname) { | ||
| // boolean exists = memberService.isNicknameDuplicated(nickname); | ||
| // String msg = exists ? "이미 사용 중인 닉네임입니다." : "사용 가능한 닉네임입니다."; | ||
| // return ResponseEntity.ok(Response.success(msg, new DuplicateCheckResponseDto(exists))); | ||
| // } | ||
| //} |
2 changes: 1 addition & 1 deletion
2
...ixlog/controller/post/PostController.java → ...ple/FixLog/controller/PostController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/example/FixLog/mock/TagTestDataInitializer.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.example.fixlog.mock; | ||
|
|
||
| import com.example.fixlog.domain.tag.Tag; | ||
| import com.example.fixlog.domain.tag.TagCategory; | ||
| import com.example.fixlog.repository.tag.TagRepository; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.boot.CommandLineRunner; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import static com.example.fixlog.domain.tag.TagCategory.*; | ||
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class TagTestDataInitializer implements CommandLineRunner { | ||
|
|
||
| private final TagRepository tagRepository; | ||
|
|
||
| @Override | ||
| public void run(String... args) { | ||
| if (tagRepository.count() == 0) { | ||
| Tag tag1 = Tag.of(MAJOR_CATEGORY, "101"); | ||
| Tag tag2 = Tag.of(MAJOR_CATEGORY, "101"); | ||
| Tag tag3 = Tag.of(MIDDLE_CATEGORY, "201"); | ||
| Tag tag4 = Tag.of(MINOR_CATEGORY, "301"); | ||
| tagRepository.saveAll(List.of(tag1, tag2, tag3, tag4)); | ||
| System.out.println("임시 태그 4개 삽입 완료"); | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/example/FixLog/repository/bookmark/BookmarkFolderRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.example.fixlog.repository.bookmark; | ||
|
|
||
| import com.example.fixlog.domain.bookmark.BookmarkFolder; | ||
| import com.example.fixlog.domain.member.Member; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface BookmarkFolderRepository extends JpaRepository<BookmarkFolder, Long> { | ||
| BookmarkFolder findByUserId(Member userId); | ||
youngseo22 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
7 changes: 7 additions & 0 deletions
7
src/main/java/com/example/FixLog/repository/post/PostTagRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.fixlog.repository.post; | ||
|
|
||
| import com.example.fixlog.domain.post.PostTag; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface PostTagRepository extends JpaRepository<PostTag, Long> { | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/example/FixLog/repository/tag/TagRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.example.fixlog.repository.tag; | ||
|
|
||
| import com.example.fixlog.domain.tag.Tag; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface TagRepository extends JpaRepository<Tag, Long> { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/com/example/FixLog/service/MemberService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| //package com.example.fixlog.service; | ||
| // | ||
| //import com.example.fixlog.domain.bookmark.BookmarkFolder; | ||
| //import com.example.fixlog.domain.member.Member; | ||
| //import com.example.fixlog.domain.member.SocialType; | ||
| //import com.example.fixlog.dto.member.SignupRequestDto; | ||
| //import com.example.fixlog.exception.CustomException; | ||
| //import com.example.fixlog.exception.ErrorCode; | ||
| //import com.example.fixlog.repository.MemberRepository; | ||
| //import com.example.fixlog.repository.bookmark.BookmarkFolderRepository; | ||
| //import lombok.RequiredArgsConstructor; | ||
| //import org.springframework.security.crypto.password.PasswordEncoder; | ||
| //import org.springframework.stereotype.Service; | ||
| // | ||
| //@Service | ||
| //@RequiredArgsConstructor | ||
| //public class MemberService { | ||
| // | ||
| // private final MemberRepository memberRepository; | ||
| // private final PasswordEncoder passwordEncoder; | ||
| // private final BookmarkFolderRepository bookmarkFolderRepository; | ||
| // | ||
| // public void signup(SignupRequestDto request) { | ||
| // // 이메일 중복 검사 | ||
| // if (isEmailDuplicated(request.getEmail())) { | ||
| // throw new CustomException(ErrorCode.EMAIL_DUPLICATED); | ||
| // } | ||
| // | ||
| // // 닉네임 중복 검사 | ||
| // if (isNicknameDuplicated(request.getNickname())) { | ||
| // throw new CustomException(ErrorCode.NICKNAME_DUPLICATED); | ||
| // } | ||
| // | ||
| // // 문제 없으면 저장 | ||
| // Member member = Member.of( | ||
| // request.getEmail(), | ||
| // passwordEncoder.encode(request.getPassword()), | ||
| // request.getNickname(), | ||
| // SocialType.EMAIL | ||
| // ); | ||
| // | ||
| // // 기본 폴더 생성 | ||
| // BookmarkFolder newFolder = new BookmarkFolder(member); | ||
| // bookmarkFolderRepository.save(newFolder); | ||
| // | ||
| // memberRepository.save(member); | ||
| // } | ||
| // | ||
| // public boolean isEmailDuplicated(String email) { | ||
| // return memberRepository.findByEmail(email).isPresent(); | ||
| // } | ||
| // | ||
| // public boolean isNicknameDuplicated(String nickname) { | ||
| // return memberRepository.findByNickname(nickname).isPresent(); | ||
| // } | ||
| //} |
62 changes: 31 additions & 31 deletions
62
src/main/java/com/example/fixlog/config/SecurityConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,31 @@ | ||
| package com.example.fixlog.config; | ||
|
|
||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.http.HttpMethod; | ||
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| import org.springframework.security.web.SecurityFilterChain; | ||
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||
| import org.springframework.security.crypto.password.PasswordEncoder; | ||
|
|
||
| @Configuration | ||
| public class SecurityConfig { | ||
|
|
||
| @Bean | ||
| public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | ||
| http | ||
| .csrf(csrf -> csrf.disable()) | ||
| .authorizeHttpRequests(auth -> auth | ||
| .requestMatchers(HttpMethod.POST, "/api/members/signup").permitAll() | ||
| .requestMatchers(HttpMethod.GET, "/api/members/check-email").permitAll() | ||
| .requestMatchers(HttpMethod.GET, "/api/members/check-nickname").permitAll() | ||
| .anyRequest().authenticated() | ||
| ); | ||
| return http.build(); | ||
| } | ||
|
|
||
| @Bean | ||
| public PasswordEncoder passwordEncoder() { | ||
| return new BCryptPasswordEncoder(); | ||
| } | ||
| } | ||
| //package com.example.fixlog.config; | ||
| // | ||
| //import org.springframework.context.annotation.Bean; | ||
| //import org.springframework.context.annotation.Configuration; | ||
| //import org.springframework.http.HttpMethod; | ||
| //import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| //import org.springframework.security.web.SecurityFilterChain; | ||
| //import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||
| //import org.springframework.security.crypto.password.PasswordEncoder; | ||
| // | ||
| //@Configuration | ||
| //public class SecurityConfig { | ||
| // | ||
| // @Bean | ||
| // public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { | ||
| // http | ||
| // .csrf(csrf -> csrf.disable()) | ||
| // .authorizeHttpRequests(auth -> auth | ||
| // .requestMatchers(HttpMethod.POST, "/api/members/signup").permitAll() | ||
| // .requestMatchers(HttpMethod.GET, "/api/members/check-email").permitAll() | ||
| // .requestMatchers(HttpMethod.GET, "/api/members/check-nickname").permitAll() | ||
| // .anyRequest().authenticated() | ||
| // ); | ||
| // return http.build(); | ||
| // } | ||
| // | ||
| // @Bean | ||
| // public PasswordEncoder passwordEncoder() { | ||
| // return new BCryptPasswordEncoder(); | ||
| // } | ||
| //} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.