Skip to content

Commit b740b02

Browse files
committed
refactor: 스프린트 1 피드백 반영
1 parent ea4db18 commit b740b02

File tree

8 files changed

+39
-8
lines changed

8 files changed

+39
-8
lines changed

src/main/java/apptive/team5/Team5Application.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88

99
import static org.springframework.data.web.config.EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO;
1010

11-
@EnableJpaAuditing
12-
@EnableScheduling
1311
@SpringBootApplication
14-
@EnableSpringDataWebSupport(pageSerializationMode = VIA_DTO)
1512
public class Team5Application {
1613

1714
public static void main(String[] args) {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package apptive.team5.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
5+
6+
@Configuration
7+
@EnableJpaAuditing
8+
public class JpaConfig {
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package apptive.team5.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.scheduling.annotation.EnableScheduling;
5+
6+
@Configuration
7+
@EnableScheduling
8+
public class SchedulerConfig {
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package apptive.team5.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.data.web.config.EnableSpringDataWebSupport;
5+
6+
import static org.springframework.data.web.config.EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO;
7+
8+
@Configuration
9+
@EnableSpringDataWebSupport(pageSerializationMode = VIA_DTO)
10+
public class WebConfig {
11+
}

src/main/java/apptive/team5/diary/controller/DiaryController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public class DiaryController {
2424
@GetMapping("/my")
2525
public ResponseEntity<Page<DiaryResponse>> getMyMusicDiary(
2626
@AuthenticationPrincipal String identifier,
27-
@RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "5") int size) {
27+
@RequestParam(defaultValue = "0") int page,
28+
@RequestParam(defaultValue = "5") int size) {
2829

2930

3031
Page<DiaryResponse> response = diaryService.getMyDiaries(identifier, PageRequest.of(page, size));

src/main/java/apptive/team5/jwt/domain/RefreshToken.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class RefreshToken {
2626
@Column(unique = true, nullable = false)
2727
private String token;
2828

29-
@OneToOne(fetch = FetchType.LAZY)
29+
@OneToOne(fetch = FetchType.LAZY, optional = false)
3030
@JoinColumn(name = "user_id", unique = true, nullable = false)
3131
private UserEntity user;
3232

src/main/java/apptive/team5/user/domain/UserEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class UserEntity {
3838
@Column(nullable = false)
3939
private SocialType socialType;
4040

41-
@OneToOne(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
41+
@OneToOne(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
4242
private RefreshToken refreshToken;
4343

4444
@Column(nullable = false)

src/main/java/apptive/team5/user/dto/UserResponse.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public record UserResponse(
1414
) {
1515

1616
public UserResponse(UserEntity userEntity) {
17-
this(userEntity.getUsername(), userEntity.getIdentifier(), userEntity.getEmail(),
18-
userEntity.getProfileImageUrl(), userEntity.getRoleType(), userEntity.getSocialType());
17+
this(userEntity.getUsername(),
18+
userEntity.getIdentifier(),
19+
userEntity.getEmail(),
20+
userEntity.getProfileImageUrl(),
21+
userEntity.getRoleType(),
22+
userEntity.getSocialType());
1923
}
2024
}

0 commit comments

Comments
 (0)