Skip to content

Commit

Permalink
Merge pull request #93 from team9502/dev
Browse files Browse the repository at this point in the history
feat: ์‚ฌ์šฉ์ž/๊ธฐ์—…(ํšŒ์›) ๋น„๋ฐ€๋ฒˆํ˜ธ ์ˆ˜์ • + ํฌ์ธํŠธ ์ด์•ก ๋‚ด์—ญ ์กฐํšŒ์‹œ ๋‹ค์Œ ํŽ˜์ด์ง€ ์—ฌ๋ถ€ ์ถ”๊ฐ€ + ๋ฆฌ๋ทฐ ์กฐํšŒ์‹œ ํ˜„์žฌ ํŽ˜์ด์ง€ ๋ฒˆํ˜ธ์™€ ์ „์ฒด ํŽ˜์ด์ง€ ์ˆ˜ ์‘๋‹ต๊ฐ’์— ํฌํ•จ + ๋ฆฌ๋ทฐ ์กฐํšŒ์‹œ ๊ณต๊ฐœ๋œ ๋ฆฌ๋ทฐ๊ฐ€ ์ตœ์ƒ๋‹จ์œผ๋กœ ์˜ค๊ฒŒ ์ˆ˜์ •
  • Loading branch information
EUNCHAEv1006 authored Jun 16, 2024
2 parents 17e55ce + f672358 commit ac8a1a4
Show file tree
Hide file tree
Showing 19 changed files with 297 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import team9502.sinchulgwinong.domain.companyUser.dto.request.CpUserPasswordUpdateRequestDTO;
import team9502.sinchulgwinong.domain.companyUser.dto.request.CpUserProfileUpdateRequestDTO;
import team9502.sinchulgwinong.domain.companyUser.dto.response.CpUserProfileResponseDTO;
import team9502.sinchulgwinong.domain.companyUser.service.CpUserService;
import team9502.sinchulgwinong.global.response.GlobalApiResponse;
import team9502.sinchulgwinong.global.security.UserDetailsImpl;

import static team9502.sinchulgwinong.global.response.SuccessCode.SUCCESS_CP_USER_PROFILE_READ;
import static team9502.sinchulgwinong.global.response.SuccessCode.SUCCESS_CP_USER_PROFILE_UPDATED;
import static team9502.sinchulgwinong.global.response.SuccessCode.*;

@RestController
@RequiredArgsConstructor
Expand All @@ -32,7 +32,7 @@ public class CpUserController {
@ApiResponses({
@ApiResponse(responseCode = "200", description = "๊ธฐ์—…(ํšŒ์›) ํ”„๋กœํ•„ ์กฐํšŒ ์„ฑ๊ณต",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"ํ”„๋กœํ•„ ์กฐํšŒ ์„ฑ๊ณต\", \"data\": {\"cpUserId\": 1, \"cpName\": \"ํŒ€9502\", \"cpEmail\": \"[email protected]\", \"cpPhoneNumber\": \"01012345678\", \"cpUsername\": \"๊น€์€์ฑ„\", \"hiringStatus\": true, \"employeeCount\": 50, \"description\": \"๊ธฐ์—… ์†Œ๊ฐœ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค.\", \"cpNum\": \"1234567890\"} }"))),
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"ํ”„๋กœํ•„ ์กฐํšŒ ์„ฑ๊ณต\", \"data\": {\"cpUserId\": 1, \"cpName\": \"ํŒ€9502\", \"cpEmail\": \"[email protected]\", \"cpPhoneNumber\": \"01012345678\", \"cpUsername\": \"๊น€์€์ฑ„\", \"hiringStatus\": true, \"employeeCount\": 50, \"foundationDate\": \"2021-01-01\", \"description\": \"๊ธฐ์—… ์†Œ๊ฐœ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค.\", \"cpNum\": \"1234567890\", \"averageRating\": 4.5, \"reviewCount\": 20} }"))),
@ApiResponse(responseCode = "400", description = "์ž˜๋ชป๋œ ์‚ฌ์šฉ์ž ์œ ํ˜•",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"400\", \"message\": \"์ž˜๋ชป๋œ ์‚ฌ์šฉ์ž ์œ ํ˜•์ž…๋‹ˆ๋‹ค.\", \"data\": null }"))),
Expand Down Expand Up @@ -87,4 +87,39 @@ public ResponseEntity<GlobalApiResponse<CpUserProfileResponseDTO>> updateCompany
)
);
}

@PatchMapping("/password")
@Operation(summary = "๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ", description = "๋กœ๊ทธ์ธํ•œ ๊ธฐ์—…(ํšŒ์›)์˜ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ์„ฑ๊ณต",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ์„ฑ๊ณต\" }"))),
@ApiResponse(responseCode = "400", description = "๋น„๋ฐ€๋ฒˆํ˜ธ ๋ถˆ์ผ์น˜ ๋˜๋Š” ์œ ํšจํ•˜์ง€ ์•Š์€ ์š”์ฒญ",
content = @Content(mediaType = "application/json",
examples = {
@ExampleObject(name = "๋น„๋ฐ€๋ฒˆํ˜ธ ๋ถˆ์ผ์น˜", value = "{ \"code\": \"400\", \"message\": \"์ž…๋ ฅํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ๊ธฐ์กด ๋น„๋ฐ€๋ฒˆํ˜ธ์™€ ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.\" }"),
@ExampleObject(name = "๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ ๋ถˆ์ผ์น˜", value = "{ \"code\": \"400\", \"message\": \"๋น„๋ฐ€๋ฒˆํ˜ธ์™€ ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ์ด ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.\" }")
})),
@ApiResponse(responseCode = "400", description = "์ž˜๋ชป๋œ ์‚ฌ์šฉ์ž ์œ ํ˜•",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"400\", \"message\": \"์ž˜๋ชป๋œ ์‚ฌ์šฉ์ž ์œ ํ˜•์ž…๋‹ˆ๋‹ค.\", \"data\": null }"))),
@ApiResponse(responseCode = "404", description = "์‚ฌ์šฉ์ž๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Œ",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"404\", \"message\": \"์‚ฌ์šฉ์ž๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.\" }"))),
@ApiResponse(responseCode = "500", description = "์„œ๋ฒ„ ๋‚ด๋ถ€ ์˜ค๋ฅ˜",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"500\", \"message\": \"์„œ๋ฒ„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.\" }")))
})
public ResponseEntity<GlobalApiResponse<Void>> updateUserProfile(
@AuthenticationPrincipal UserDetailsImpl userDetails,
@RequestBody CpUserPasswordUpdateRequestDTO requestDTO) {

cpUserService.updateCpUserPassword(userDetails.getCpUserId(), requestDTO);

return ResponseEntity.status(SUCCESS_USER_PASSWORD_UPDATED.getHttpStatus())
.body(
GlobalApiResponse.of(
SUCCESS_USER_PASSWORD_UPDATED.getMessage(),
null));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package team9502.sinchulgwinong.domain.companyUser.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class CpUserPasswordUpdateRequestDTO {

@Schema(description = "ํ˜„์žฌ ๋น„๋ฐ€๋ฒˆํ˜ธ", example = "password")
private String currentPassword;

@Schema(description = "๋ณ€๊ฒฝํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ", example = "newPassword")
private String newPassword;

@Schema(description = "๋ณ€๊ฒฝํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ", example = "newPassword")
private String newPasswordConfirm;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ public class CpUserProfileResponseDTO {

@Schema(description = "์‚ฌ์—…์ž ๋ฒˆํ˜ธ", example = "1234567890")
private String cpNum;

@Schema(description = "ํ‰๊ท  ํ‰์ ", example = "4.5")
private Float averageRating;

@Schema(description = "๋ฆฌ๋ทฐ ๊ฐœ์ˆ˜", example = "10")
private Integer reviewCount;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ public class CompanyUser extends BaseTimeEntity implements CommonPoint {
@Column(nullable = false, length = 11)
private String cpPhoneNumber;

@Setter
@Column(nullable = false, length = 150)
private String cpPassword;

@Setter
@Column(nullable = true)
private Float averageRating;

@Setter
@Column(nullable = true)
private Integer reviewCount;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@


import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import team9502.sinchulgwinong.domain.companyUser.dto.request.CpUserPasswordUpdateRequestDTO;
import team9502.sinchulgwinong.domain.companyUser.dto.request.CpUserProfileUpdateRequestDTO;
import team9502.sinchulgwinong.domain.companyUser.dto.response.CpUserProfileResponseDTO;
import team9502.sinchulgwinong.domain.companyUser.entity.CompanyUser;
Expand All @@ -17,6 +19,7 @@ public class CpUserService {

private final CompanyUserRepository companyUserRepository;
private final EncryptionService encryptionService;
private final PasswordEncoder passwordEncoder;

@Transactional(readOnly = true)
public CpUserProfileResponseDTO getCpUserProfile(Long cpUserId) {
Expand All @@ -34,7 +37,9 @@ public CpUserProfileResponseDTO getCpUserProfile(Long cpUserId) {
companyUser.getEmployeeCount(),
companyUser.getFoundationDate(),
companyUser.getDescription(),
encryptionService.decryptCpNum(companyUser.getCpNum())
encryptionService.decryptCpNum(companyUser.getCpNum()),
companyUser.getAverageRating(),
companyUser.getReviewCount()
);
}

Expand Down Expand Up @@ -70,7 +75,27 @@ public CpUserProfileResponseDTO updateCpUserProfile(Long cpUserId, CpUserProfile
companyUser.getEmployeeCount(),
companyUser.getFoundationDate(),
companyUser.getDescription(),
encryptionService.decryptCpNum(companyUser.getCpNum())
encryptionService.decryptCpNum(companyUser.getCpNum()),
companyUser.getAverageRating(),
companyUser.getReviewCount()
);
}

@Transactional
public void updateCpUserPassword(Long cpUserId, CpUserPasswordUpdateRequestDTO requestDTO) {

CompanyUser companyUser = companyUserRepository.findById(cpUserId)
.orElseThrow(() -> new ApiException(ErrorCode.COMPANY_USER_NOT_FOUND));

if (!passwordEncoder.matches(requestDTO.getCurrentPassword(), companyUser.getCpPassword())) {
throw new ApiException(ErrorCode.PASSWORD_MISMATCH);
}

if (!requestDTO.getNewPassword().equals(requestDTO.getNewPasswordConfirm())) {
throw new ApiException(ErrorCode.PASSWORD_CONFIRM_MISMATCH);
}

companyUser.setCpPassword(passwordEncoder.encode(requestDTO.getNewPassword()));
companyUserRepository.save(companyUser);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import team9502.sinchulgwinong.domain.point.dto.response.PagedResponseDTO;
import team9502.sinchulgwinong.domain.point.dto.response.PointSummaryResponseDTO;
import team9502.sinchulgwinong.domain.point.dto.response.SavedPointDetailResponseDTO;
import team9502.sinchulgwinong.domain.point.dto.response.UsedPointDetailResponseDTO;
import team9502.sinchulgwinong.domain.point.service.PointService;
import team9502.sinchulgwinong.global.response.GlobalApiResponse;
import team9502.sinchulgwinong.global.security.UserDetailsImpl;

import java.util.List;

import static team9502.sinchulgwinong.global.response.SuccessCode.*;

@RestController
Expand Down Expand Up @@ -66,7 +65,7 @@ public ResponseEntity<GlobalApiResponse<PointSummaryResponseDTO>> getPointSummar
@ApiResponses({
@ApiResponse(responseCode = "200", description = "ํฌ์ธํŠธ ์ ๋ฆฝ ๋‚ด์—ญ ์กฐํšŒ ์„ฑ๊ณต",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"์ ๋ฆฝ ํฌ์ธํŠธ ์กฐํšŒ ์„ฑ๊ณต\", \"data\": [{\"type\": \"REVIEW\", \"savedPoint\": 300, \"createdAt\": \"2024-06-11\"}, {\"type\": \"SIGNUP\", \"savedPoint\": 300, \"createdAt\": \"2024-06-11\"}] }"))),
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"์ ๋ฆฝ ํฌ์ธํŠธ ์กฐํšŒ ์„ฑ๊ณต\", \"data\": [{\"type\": \"REVIEW\", \"savedPoint\": 300, \"createdAt\": \"2024-06-11\"}, {\"type\": \"SIGNUP\", \"savedPoint\": 300, \"createdAt\": \"2024-06-11\", \"hasNextPage\": false}] }"))),
@ApiResponse(responseCode = "404", description = "ํฌ์ธํŠธ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(value = "{ \"code\": \"404\", \"message\": \"ํฌ์ธํŠธ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.\", \"data\": null }"))),
Expand All @@ -86,7 +85,7 @@ public ResponseEntity<GlobalApiResponse<PointSummaryResponseDTO>> getPointSummar
required = false,
schema = @Schema(type = "integer", defaultValue = "6")
)
public ResponseEntity<GlobalApiResponse<List<SavedPointDetailResponseDTO>>> getPointDetails(
public ResponseEntity<GlobalApiResponse<PagedResponseDTO<SavedPointDetailResponseDTO>>> getPointDetails(
@AuthenticationPrincipal UserDetailsImpl userDetails,
@RequestParam(value = "cursorId", required = false) Long cursorId,
@RequestParam(value = "limit", defaultValue = "6") int limit) {
Expand All @@ -95,7 +94,7 @@ public ResponseEntity<GlobalApiResponse<List<SavedPointDetailResponseDTO>>> getP
cursorId = Long.MAX_VALUE;
}

List<SavedPointDetailResponseDTO> responseDTOs = pointService.getSpDetails(userDetails, cursorId, limit);
PagedResponseDTO<SavedPointDetailResponseDTO> responseDTOs = pointService.getSpDetails(userDetails, cursorId, limit);

return ResponseEntity.status(SUCCESS_SAVED_POINT_READ.getHttpStatus())
.body(
Expand Down Expand Up @@ -129,7 +128,7 @@ public ResponseEntity<GlobalApiResponse<List<SavedPointDetailResponseDTO>>> getP
@ApiResponse(responseCode = "200", description = "ํฌ์ธํŠธ ์‚ฌ์šฉ ๋‚ด์—ญ ์กฐํšŒ ์„ฑ๊ณต",
content = @Content(mediaType = "application/json",
examples = @ExampleObject(
value = "{ \"code\": \"200\", \"message\": \"ํฌ์ธํŠธ ์‚ฌ์šฉ ๋‚ด์—ญ ์กฐํšŒ ์„ฑ๊ณต\", \"data\": [{\"type\": \"REVIEW\", \"usedPoint\": 100, \"usedAt\": \"2024-06-11\"}, {\"type\": \"BANNER\", \"usedPoint\": 50, \"usedAt\": \"2024-06-10\"}] }"
value = "{ \"code\": \"200\", \"message\": \"ํฌ์ธํŠธ ์‚ฌ์šฉ ๋‚ด์—ญ ์กฐํšŒ ์„ฑ๊ณต\", \"data\": [{\"type\": \"REVIEW\", \"usedPoint\": 100, \"usedAt\": \"2024-06-11\", \"hasNextPage\": true}, {\"type\": \"BANNER\", \"usedPoint\": 50, \"usedAt\": \"2024-06-10\", \"hasNextPage\": false}] }"
)
)
),
Expand All @@ -144,7 +143,7 @@ public ResponseEntity<GlobalApiResponse<List<SavedPointDetailResponseDTO>>> getP
)
)
})
public ResponseEntity<GlobalApiResponse<List<UsedPointDetailResponseDTO>>> getUsedPointDetails(
public ResponseEntity<GlobalApiResponse<PagedResponseDTO<UsedPointDetailResponseDTO>>> getUsedPointDetails(
@AuthenticationPrincipal UserDetailsImpl userDetails,
@RequestParam(value = "cursorId", required = false) Long cursorId,
@RequestParam(value = "limit", defaultValue = "6") int limit) {
Expand All @@ -153,7 +152,7 @@ public ResponseEntity<GlobalApiResponse<List<UsedPointDetailResponseDTO>>> getUs
cursorId = Long.MAX_VALUE;
}

List<UsedPointDetailResponseDTO> responseDTOs = pointService.getUpDetails(userDetails, cursorId, limit);
PagedResponseDTO<UsedPointDetailResponseDTO> responseDTOs = pointService.getUpDetails(userDetails, cursorId, limit);

return ResponseEntity.status(SUCCESS_USED_POINT_READ.getHttpStatus())
.body(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package team9502.sinchulgwinong.domain.point.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PagedResponseDTO<T> {

private List<T> data;

@Schema(description = "๋‹ค์Œ ํŽ˜์ด์ง€ ์กด์žฌ ์—ฌ๋ถ€", example = "true")
private boolean hasNextPage;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import team9502.sinchulgwinong.domain.companyUser.entity.CompanyUser;
import team9502.sinchulgwinong.domain.companyUser.repository.CompanyUserRepository;
import team9502.sinchulgwinong.domain.point.CommonPoint;
import team9502.sinchulgwinong.domain.point.dto.response.PagedResponseDTO;
import team9502.sinchulgwinong.domain.point.dto.response.PointSummaryResponseDTO;
import team9502.sinchulgwinong.domain.point.dto.response.SavedPointDetailResponseDTO;
import team9502.sinchulgwinong.domain.point.dto.response.UsedPointDetailResponseDTO;
Expand All @@ -18,7 +18,6 @@
import team9502.sinchulgwinong.domain.point.repository.SavedPointRepository;
import team9502.sinchulgwinong.domain.point.repository.UsedPointRepository;
import team9502.sinchulgwinong.domain.user.entity.User;
import team9502.sinchulgwinong.domain.user.repository.UserRepository;
import team9502.sinchulgwinong.global.exception.ApiException;
import team9502.sinchulgwinong.global.exception.ErrorCode;
import team9502.sinchulgwinong.global.security.UserDetailsImpl;
Expand All @@ -30,8 +29,6 @@
@RequiredArgsConstructor
public class PointService {

private final UserRepository userRepository;
private final CompanyUserRepository companyUserRepository;
private final PointRepository pointRepository;
private final SavedPointRepository savedPointRepository;
private final UsedPointRepository usedPointRepository;
Expand Down Expand Up @@ -137,33 +134,47 @@ public PointSummaryResponseDTO getPointSummary(UserDetailsImpl userDetails) {
}

@Transactional(readOnly = true)
public List<SavedPointDetailResponseDTO> getSpDetails(UserDetailsImpl userDetails, Long cursorId, int limit) throws ApiException {
public PagedResponseDTO<SavedPointDetailResponseDTO> getSpDetails(UserDetailsImpl userDetails, Long cursorId, int limit) throws ApiException {

Long pointId = getPointId(userDetails);

if (cursorId == null) {
cursorId = Long.MAX_VALUE;
}
List<SavedPoint> savedPoints = savedPointRepository.findSavedPointsWithCursor(pointId, cursorId, limit);
List<SavedPoint> savedPoints = savedPointRepository.findSavedPointsWithCursor(pointId, cursorId, limit + 1);
boolean hasNextPage = savedPoints.size() > limit;

return savedPoints.stream()
if (hasNextPage) {
savedPoints.remove(savedPoints.size() - 1);
}

List<SavedPointDetailResponseDTO> dtoList = savedPoints.stream()
.map(sp -> new SavedPointDetailResponseDTO(sp.getSpType(), sp.getSpAmount(), sp.getCreatedAt().toLocalDate()))
.collect(Collectors.toList());

return new PagedResponseDTO<>(dtoList, hasNextPage);
}

@Transactional(readOnly = true)
public List<UsedPointDetailResponseDTO> getUpDetails(UserDetailsImpl userDetails, Long cursorId, int limit) throws ApiException {
public PagedResponseDTO<UsedPointDetailResponseDTO> getUpDetails(UserDetailsImpl userDetails, Long cursorId, int limit) throws ApiException {

Long pointId = getPointId(userDetails);

if (cursorId == null) {
cursorId = Long.MAX_VALUE;
}
List<UsedPoint> usedPoints = usedPointRepository.findUsedPointsWithCursor(pointId, cursorId, limit);
List<UsedPoint> usedPoints = usedPointRepository.findUsedPointsWithCursor(pointId, cursorId, limit + 1);
boolean hasNextPage = usedPoints.size() > limit;

return usedPoints.stream()
if (hasNextPage) {
usedPoints.remove(usedPoints.size() - 1);
}

List<UsedPointDetailResponseDTO> dtoList = usedPoints.stream()
.map(up -> new UsedPointDetailResponseDTO(up.getUpType(), up.getUpAmount(), up.getCreatedAt().toLocalDate()))
.collect(Collectors.toList());

return new PagedResponseDTO<>(dtoList, hasNextPage);
}

/*
Expand Down
Loading

0 comments on commit ac8a1a4

Please sign in to comment.