Skip to content

Commit 21746c2

Browse files
authored
Merge pull request #26 from KONKUK-MAP-Service/feat-spot
✔️ [Fix] : 장소 외래키 제약조건 오류 수정 #26
2 parents 5062f22 + 49ea18d commit 21746c2

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

Ku-suk-Ku-suk

-1
This file was deleted.

src/main/java/com/cona/KUsukKusuk/comment/domain/Comment.java

+1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ public class Comment extends BaseEntity {
3636
@Column(nullable = false)
3737
private String comment;
3838

39+
3940
}

src/main/java/com/cona/KUsukKusuk/global/security/LoginFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected void successfulAuthentication(HttpServletRequest request, HttpServletR
8383

8484
String password = customUserDetails.getPassword();
8585
//AT : 6분
86-
String accessToken = jwtUtil.createJwt(username, password, 60*60*100L);
86+
String accessToken = jwtUtil.createJwt(username, password, 60*60*1000L);
8787
//RT : 7일
8888
String refreshToken = jwtUtil.createRefreshToken(username, password, 86400000*7L);
8989

src/main/java/com/cona/KUsukKusuk/spot/domain/Spot.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.cona.KUsukKusuk.like.UserLike;
77
import com.cona.KUsukKusuk.picture.Picture;
88
import com.cona.KUsukKusuk.user.domain.User;
9+
import jakarta.persistence.CascadeType;
910
import jakarta.persistence.Column;
1011
import jakarta.persistence.ElementCollection;
1112
import jakarta.persistence.Entity;
@@ -36,16 +37,16 @@ public class Spot extends BaseEntity {
3637
@JoinColumn(name = "user_id")
3738
private User user;
3839

39-
@OneToMany(mappedBy = "spot")
40+
@OneToMany(mappedBy = "spot", cascade = CascadeType.REMOVE)
4041
private List<UserLike> userLikes = new ArrayList<>();
4142

4243
@OneToMany(mappedBy = "spot")
4344
private List<Picture> pictures = new ArrayList<>();
4445

45-
@OneToMany(mappedBy = "spot")
46+
@OneToMany(mappedBy = "spot",cascade = CascadeType.REMOVE)
4647
private List<Comment> comments = new ArrayList<>();
4748

48-
@OneToMany(mappedBy = "spot")
49+
@OneToMany(mappedBy = "spot", cascade = CascadeType.REMOVE)
4950
private List<Bookmark> bookmarks = new ArrayList<>();
5051
@Column(nullable = false)
5152
private String spotName;

src/main/java/com/cona/KUsukKusuk/user/dto/BoomarkLikeResponseDto.java

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
public record BoomarkLikeResponseDto(
1010

1111
String spotName,
12+
Long spotId,
1213
String review,
1314
LocalDateTime createDate,
1415

@@ -26,6 +27,8 @@ public static BoomarkLikeResponseDto of(Spot spot, Boolean isBookmark, Boolean i
2627
return BoomarkLikeResponseDto.builder()
2728
.spotName(spot.getSpotName())
2829
.spotImageurl(spot.getImageUrls().get(0))
30+
.createDate(spot.getCreatedDate())
31+
.spotId(spot.getId())
2932
.review(spot.getReview())
3033
.author(spot.getUser().getNickname())
3134
.bookmark(isBookmark)

src/main/java/com/cona/KUsukKusuk/user/service/UserService.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.stream.Collectors;
3434
import java.util.stream.Stream;
3535
import lombok.RequiredArgsConstructor;
36+
import lombok.extern.slf4j.Slf4j;
3637
import org.apache.commons.lang3.RandomStringUtils;
3738
import org.springframework.data.domain.Page;
3839
import org.springframework.data.domain.PageImpl;
@@ -44,6 +45,7 @@
4445

4546
@Service
4647
@RequiredArgsConstructor
48+
@Slf4j
4749
public class UserService {
4850
private final UserRepository userRepository;
4951
private final CommentRepository commentRepository;
@@ -136,12 +138,13 @@ public String findPassword(String userId, String email) {
136138
User member=userRepository.findByUserId(userId)
137139
.orElseThrow(() -> new UserNotFoundException(HttpExceptionCode.USERID_NOT_FOUND));
138140

139-
if (member.getEmail() != email) {
141+
if (!member.getEmail().equals(email)) {
140142
throw new UserNotFoundException(HttpExceptionCode.EMAIL_USER_NOT_EQUAL);
141143
}
142144

143145
String newPassword = generateNewPassword();
144146
member.setPassword(bCryptPasswordEncoder.encode(newPassword));
147+
member.setNoCryptpassword(newPassword);
145148
userRepository.save(member);
146149

147150
String title = "쿠석쿠석 임시 비밀번호 발급";

src/main/resources/application.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ spring:
4141
password : ${redis_password}
4242
servlet:
4343
multipart:
44-
maxFileSize: 10MB
45-
maxRequestSize: 30MB
44+
maxFileSize: 30MB
45+
maxRequestSize: 60MB
4646

4747
decorator:
4848
datasource:

0 commit comments

Comments
 (0)