Skip to content

Commit 669c0ca

Browse files
authored
Merge pull request #106 from prgrms-web-devcourse-final-project/dev
Dev
2 parents c647b26 + d987a7d commit 669c0ca

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/com/grepp/teamnotfound/app/controller/api/auth/AuthController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public ResponseEntity<ApiResponse<?>> registerAdmin(@RequestBody RegisterRequest
9696
@Operation(summary = "소셜 로그인")
9797
@GetMapping("v1/social-auth/{provider}")
9898
public ResponseEntity<?> socialLogin(@PathVariable String provider) {
99-
ProviderType providerType = ProviderType.valueOf(provider.toUpperCase());
99+
ProviderType providerType = ProviderType.valueOf(provider.toLowerCase());
100100
String url = customOAuth2UserService.getAuthUrl(providerType);
101101
return ResponseEntity.ok(url);
102102
}

src/main/java/com/grepp/teamnotfound/app/controller/api/dashboard/DashboardApiController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public ResponseEntity<?> getDashboardProfile(
5757
){
5858
PetDto petDto = dashboardService.getProfile(petId, principal.getUserId());
5959
ProfileResponse response = modelMapper.map(petDto, ProfileResponse.class);
60-
response.setAge(Period.between(petDto.getBirthday(), date).getMonths());
60+
61+
Period period = Period.between(petDto.getBirthday(), date);
62+
int totalMonths = period.getYears() * 12 + period.getMonths();
63+
response.setAge(totalMonths);
6164

6265
String analysis = aiAnalysisService.getAiAnalysis(petId, date);
6366
if (analysis == null) {

src/main/java/com/grepp/teamnotfound/app/model/dashboard/DashboardService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ public class DashboardService {
5353
public PetDto getProfile(Long petId, Long userId) {
5454
Pet pet = petService.getPet(petId);
5555
if(!pet.getUser().getUserId().equals(userId)) throw new UserException(UserErrorCode.USER_ACCESS_DENIED);
56-
57-
return modelMapper.map(pet, PetDto.class);
56+
PetDto dto = modelMapper.map(pet, PetDto.class);
57+
dto.setImgUrl(petService.getProfileImgPath(petId));
58+
return dto;
5859
}
5960

6061
@Transactional(readOnly = true)

src/main/java/com/grepp/teamnotfound/app/model/user/AdminService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ public Page<ReportsListDto> getReportsList(ReportsListRequest request) {
238238
return reportRepository.findReportListWithMeta(request, pageable);
239239
}
240240

241+
@Transactional
241242
public void updateUserSuspensionEndAtNow(Long userId) {
242243
User user = userRepository.findById(userId)
243244
.orElseThrow(() -> new BusinessException(UserErrorCode.USER_NOT_FOUND));

0 commit comments

Comments
 (0)