Skip to content

Commit d9000bd

Browse files
Merge pull request #129 from phuuthanh-dev/develop
2 parents 9c30921 + 8347341 commit d9000bd

30 files changed

+127
-78
lines changed

db/init.sql

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,19 @@ CREATE TABLE [dbo].[user]
8484
[ward] [nvarchar](50) NOT NULL,
8585
[year_of_birth] [varchar](4) NOT NULL,
8686
[bank_id] [int] NULL,
87-
[register_date] [datetime2](6) NULL
87+
[register_date] [datetime2](6) NULL,
88+
[ban_reason] [varchar](255) NULL
8889
)
8990

9091
-- Insert data into the user table
9192
INSERT INTO [dbo].[user]
9293
([cccd], [address], [avatar], [city], [email], [first_name], [last_name], [password], [phone], [district], [ward],
93-
[state], [username], [year_of_birth], [role], [bank_id], [bank_account_number], [bank_account_name], [register_date], [cccd_first], [cccd_last], [cccd_from])
94+
[state], [username], [year_of_birth], [role], [bank_id], [bank_account_number], [bank_account_name], [register_date], [cccd_first], [cccd_last], [cccd_from], [ban_reason])
9495
VALUES ('011234567890', N'1 Lý Thường Kiệt',
9596
'https://scontent.fsgn2-7.fna.fbcdn.net/v/t39.30808-6/438275285_1101091104487039_4035794765477072253_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=5f2048&_nc_ohc=7MHTOamLKXgQ7kNvgGdad4i&_nc_ht=scontent.fsgn2-7.fna&oh=00_AYDZ0L0Y3_1M_tK5YBX-b1PhjuTPFeLod8Jz1UhW3t_Gkg&oe=6665416E',
9697
N'Lâm Đồng', 'phuuthanh2003@gmail.com', N'Phùng', N'Thành',
9798
'$2a$12$j/1n5Pjv4JgzG76ZG0hyH.MD6ftohJNbjuZjRHQFt31Ta/jViwKQ2', '0912345670', N'Hà Nội', N'Hoang', 'ACTIVE',
98-
'phuuthanh2003', 1985, 'ADMIN', 7, '1030293193991', 'PHUNG HUU THANH', '2024-05-01 17:30:00', '01', '123456', 'CA NINH');
99+
'phuuthanh2003', 1985, 'ADMIN', 7, '1030293193991', 'PHUNG HUU THANH', '2024-05-01 17:30:00', '01', '123456', 'CA NINH', '');
99100

100101

101102
CREATE TABLE [dbo].[jewelry]
@@ -105,7 +106,7 @@ CREATE TABLE [dbo].[jewelry]
105106
[description] [nvarchar](max) NOT NULL,
106107
[material] [nvarchar](20) NOT NULL,
107108
[name] [nvarchar](50) NOT NULL,
108-
[price] [float] NULL,
109+
[buy_now_price] [float] NULL,
109110
[state] [nvarchar](20) NOT NULL,
110111
[weight] [float] NOT NULL,
111112
[category_id] [int] NULL,
@@ -114,7 +115,7 @@ CREATE TABLE [dbo].[jewelry]
114115
)
115116

116117
INSERT INTO [dbo].[jewelry]
117-
([brand], [description], [material], [name], [price], [state], [weight], [category_id], [user_id], [is_holding])
118+
([brand], [description], [material], [name], [buy_now_price], [state], [weight], [category_id], [user_id], [is_holding])
118119
VALUES (N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN ĐÍNH HÔN KIM CƯƠNG ENR3111W', 44500000, 'ACTIVE',
119120
15.5, 2, 1, 1),
120121
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN CƯỚI KIM CƯƠNG IWR163', 5000000, 'ACTIVE', 8.2, 2,
@@ -194,7 +195,7 @@ CREATE TABLE [dbo].[image]
194195
[icon] [bit] NULL,
195196
[link] [varchar](255) NULL,
196197
[jewelry_id] [int] NULL
197-
)
198+
)
198199

199200
INSERT INTO [dbo].[image] ([data], [icon], [link], [jewelry_id])
200201
VALUES
@@ -215,13 +216,15 @@ CREATE TABLE [dbo].[transaction](
215216
[total_price] [float] NOT NULL,
216217
[transaction_type] [varchar](255) NOT NULL,
217218
[auction_id] [int] NULL,
218-
[user_id] [int] NULL
219-
)
219+
[user_id] [int] NULL,
220+
[transaction_code] [varchar](255) NULL,
221+
[bank_code] [varchar](255) NULL
222+
)
220223

221-
INSERT INTO [dbo].[transaction] ([create_date], [fees_incurred], [payment_method], [payment_time], [transaction_state], [total_price], [transaction_type], [auction_id], [user_id])
224+
INSERT INTO [dbo].[transaction] ([create_date], [fees_incurred], [payment_method], [payment_time], [transaction_state], [total_price], [transaction_type], [auction_id], [user_id], [transaction_code], [bank_code])
222225
VALUES
223-
('2024-05-01 17:30:00', 100000, 'BANKING', '2024-05-01 17:30:00', 'SUCCEED', 1000000, 'REGISTRATION', 1, 1),
224-
('2024-05-12 19:30:00', 200000, 'BANKING', '2024-05-12 19:30:00', 'SUCCEED', 2000000, 'REGISTRATION', 2, 1);
226+
('2024-05-01 17:30:00', 100000, 'BANKING', '2024-05-01 17:30:00', 'SUCCEED', 1000000, 'REGISTRATION', 1, 1, 'BAS12', 'AGB'),
227+
('2024-05-12 19:30:00', 200000, 'BANKING', '2024-05-12 19:30:00', 'SUCCEED', 2000000, 'REGISTRATION', 2, 1, 'BAS22', 'NCB');
225228

226229

227230

src/main/java/vn/webapp/backend/auction/controller/AuctionController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
import jakarta.mail.MessagingException;
44
import lombok.RequiredArgsConstructor;
5-
import org.springframework.beans.factory.annotation.Autowired;
65
import org.springframework.data.domain.Page;
76
import org.springframework.data.domain.PageRequest;
87
import org.springframework.data.domain.Pageable;
98
import org.springframework.data.domain.Sort;
109
import org.springframework.http.ResponseEntity;
1110
import org.springframework.web.bind.annotation.*;
12-
import vn.webapp.backend.auction.dto.AuctionRegistrationDTO;
11+
import vn.webapp.backend.auction.dto.AuctionRegistrationResponse;
1312
import vn.webapp.backend.auction.dto.AuctionRequest;
1413
import vn.webapp.backend.auction.enums.AuctionState;
1514
import vn.webapp.backend.auction.model.Auction;
@@ -131,7 +130,7 @@ public ResponseEntity<Auction> createNewAuction(@RequestBody AuctionRequest requ
131130
}
132131

133132
@GetMapping("/get-auction-registration")
134-
public ResponseEntity<Page<AuctionRegistrationDTO>> getAuctionRegistrations(
133+
public ResponseEntity<Page<AuctionRegistrationResponse>> getAuctionRegistrations(
135134
@RequestParam(defaultValue = "startDate") String sortBy,
136135
@RequestParam(required = false) String auctionName,
137136
@RequestParam(defaultValue = "ALL") String state,

src/main/java/vn/webapp/backend/auction/controller/AuthenticationController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public ResponseEntity<AuthenticationResponse> authenticateGeneral(
2525
@RequestBody AuthenticationRequest request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws MessagingException {
2626

2727
AuthenticationResponse authenticationResponse = authenticationService.authenticateGeneral(request, httpServletRequest, httpServletResponse);
28+
29+
if (authenticationResponse.getBanReason() != null) {
30+
return ResponseEntity.status(403).body(authenticationResponse);
31+
}
32+
2833
return ResponseEntity.ok().body(authenticationResponse);
2934
}
3035

src/main/java/vn/webapp/backend/auction/controller/RequestApprovalController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ public ResponseEntity<Page<RequestApproval>> getRequestByRoleOfSender(
6565
public ResponseEntity<Page<RequestApproval>> getRequestNeedMemberConfirm(
6666
@PathVariable Integer memberId,
6767
@RequestParam(defaultValue = "id") String sortBy,
68+
@RequestParam(required = false) String jewelryName,
6869
@RequestParam(defaultValue = "0") int page,
6970
@RequestParam(defaultValue = "5") int size,
7071
@RequestParam(defaultValue = "asc") String sortOrder) {
7172
Sort.Direction direction = (sortOrder.equalsIgnoreCase("asc")) ? Sort.Direction.ASC : Sort.Direction.DESC;
7273
Pageable pageable = PageRequest.of(page, size, direction, sortBy);
73-
return ResponseEntity.ok(requestApprovalService.getRequestNeedConfirmByMember(memberId, pageable));
74+
return ResponseEntity.ok(requestApprovalService.getRequestNeedConfirmByMember(memberId,jewelryName, pageable));
7475
}
7576

7677
@PostMapping("/send-from-user")

src/main/java/vn/webapp/backend/auction/controller/UserController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
import org.springframework.data.domain.Sort;
88
import org.springframework.http.ResponseEntity;
99
import org.springframework.web.bind.annotation.*;
10-
import vn.webapp.backend.auction.dto.ChangePasswordRequest;
1110
import vn.webapp.backend.auction.dto.RegisterAccountRequest;
12-
import vn.webapp.backend.auction.dto.UserSpentDTO;
11+
import vn.webapp.backend.auction.dto.UserSpentResponse;
1312
import vn.webapp.backend.auction.enums.AccountState;
1413
import vn.webapp.backend.auction.enums.Role;
1514
import vn.webapp.backend.auction.model.User;
@@ -101,7 +100,7 @@ public ResponseEntity<List<User>> getUserRegistrationAuctionByAuction(@PathVaria
101100
}
102101

103102
@GetMapping("/get-top-spent-user")
104-
public ResponseEntity<List<UserSpentDTO>> getTopUser() {
103+
public ResponseEntity<List<UserSpentResponse>> getTopUser() {
105104
return ResponseEntity.ok(userService.getMostSpentUser());
106105
}
107106

src/main/java/vn/webapp/backend/auction/controller/VNPAYController.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import vn.webapp.backend.auction.service.vnpay.ResponseObject;
1414

1515
import java.io.IOException;
16+
import java.util.Map;
1617

1718
@RestController
1819
@CrossOrigin(origins = {"http://localhost:3000", "https://fe-deploy-hazel.vercel.app"})
@@ -38,38 +39,40 @@ public void payCallbackHandler(
3839
@RequestParam("auctionId") Integer auctionId,
3940
@RequestParam("transactionId") Integer transactionId
4041
) throws IOException {
42+
String bankCode = request.getParameter("vnp_BankCode");
4143
String status = request.getParameter("vnp_ResponseCode");
44+
String transactionCode = request.getParameter("vnp_TransactionNo");
4245
String redirectUrl = "";
4346

4447
if (transactionId == 0) {
45-
redirectUrl = handleAuctionPaymentCallback(username, auctionId, status);
48+
redirectUrl = handleAuctionPaymentCallback(username, auctionId, status, transactionCode, bankCode);
4649
} else {
47-
redirectUrl = handleTransactionPaymentCallback(transactionId, status);
50+
redirectUrl = handleTransactionPaymentCallback(transactionId, status, transactionCode, bankCode);
4851
}
4952
response.sendRedirect(redirectUrl);
5053
}
5154

52-
private String handleAuctionPaymentCallback(String username, Integer auctionId, String status) {
55+
private String handleAuctionPaymentCallback(String username, Integer auctionId, String status, String transactionCode, String bankCode) {
5356
String baseUrl = frontendConfiguration.getBaseUrl() + "/tai-san-dau-gia/";
5457
String redirectUrl = baseUrl + auctionId;
5558

5659
if (!status.equals("00")) {
5760
redirectUrl += "?paymentStatus=failed";
5861
} else {
59-
auctionRegistrationService.registerUserForAuction(username, auctionId);
62+
auctionRegistrationService.registerUserForAuction(username, auctionId, transactionCode, bankCode);
6063
redirectUrl += "?paymentStatus=success";
6164
}
6265

6366
return redirectUrl;
6467
}
6568

66-
private String handleTransactionPaymentCallback(Integer transactionId, String status) {
69+
private String handleTransactionPaymentCallback(Integer transactionId, String status, String transactionCode, String bankCode) {
6770
String redirectUrl = frontendConfiguration.getBaseUrl() + "/thong-tin-ca-nhan/";
6871

6972
if (!status.equals("00")) {
7073
redirectUrl += "?paymentStatus=failed";
7174
} else {
72-
transactionService.setTransactionAfterPaySuccess(transactionId);
75+
transactionService.setTransactionAfterPaySuccess(transactionId, transactionCode, bankCode);
7376
redirectUrl += "?paymentStatus=success";
7477
}
7578

src/main/java/vn/webapp/backend/auction/dto/AuctionRegistrationDTO.java renamed to src/main/java/vn/webapp/backend/auction/dto/AuctionRegistrationResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import java.sql.Timestamp;
66

7-
public record AuctionRegistrationDTO (
7+
public record AuctionRegistrationResponse(
88
Integer id,
99
String name,
1010
Timestamp startDate,

src/main/java/vn/webapp/backend/auction/dto/AuthenticationResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ public class AuthenticationResponse {
1414

1515
@JsonProperty("access_token")
1616
private String accessToken;
17+
18+
private String banReason;
1719
}

src/main/java/vn/webapp/backend/auction/dto/SendJewelryFromUserRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public record SendJewelryFromUserRequest(
44
Integer userId,
5-
Double price,
5+
Double buyNowPrice,
66
String description,
77
String material,
88
Double weight,

src/main/java/vn/webapp/backend/auction/dto/UserSpentDTO.java

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package vn.webapp.backend.auction.dto;
2+
3+
public record UserSpentResponse (
4+
Integer id,
5+
String avatar,
6+
String username,
7+
String fullName,
8+
String email,
9+
String phone,
10+
Double totalSpent
11+
) {
12+
}

src/main/java/vn/webapp/backend/auction/model/Jewelry.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ public class Jewelry {
2424
@NotBlank(message = "The price required")
2525
private String name;
2626

27+
@Column(name = "buy_now_price")
2728
@Min(value = 1, message = "The price must be at least 1")
28-
private Double price;
29+
private Double buyNowPrice;
2930

3031
@Column(name = "description", nullable = false)
3132
private String description;
@@ -39,7 +40,7 @@ public class Jewelry {
3940
@Column(name = "weight", nullable = false)
4041
private Double weight;
4142

42-
@Column(name = "is_holding", nullable = true)
43+
@Column(name = "is_holding")
4344
private Boolean isHolding;
4445

4546
@Column(name = "state", nullable = false)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package vn.webapp.backend.auction.model;
22

33
public class ReasonMessages {
4-
public static final String DO_NOT_PAY_ON_TIME = "Không thanh toán giao dịch đúng thời hạn quy định.";
4+
public static final String DO_NOT_PAY_ON_TIME = "Không thanh toán hóa đơn đúng thời hạn quy định.";
55
}

src/main/java/vn/webapp/backend/auction/model/Transaction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public class Transaction {
4646
@Column(name = "transaction_type", nullable = false)
4747
private TransactionType type;
4848

49+
@Column(name = "transaction_code")
50+
private String transactionCode;
51+
52+
@Column(name = "bank_code")
53+
private String bankCode;
54+
4955
@ManyToOne(cascade = {
5056
CascadeType.PERSIST, CascadeType.DETACH,
5157
CascadeType.MERGE, CascadeType.REFRESH

src/main/java/vn/webapp/backend/auction/model/User.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ public class User implements UserDetails {
8989
@Column(name = "CCCD_from", length = 50)
9090
private String cccdFrom;
9191

92+
@Column(name = "ban_reason")
93+
private String banReason;
94+
9295
@Column(name = "register_date")
9396
private Timestamp registerDate;
9497

src/main/java/vn/webapp/backend/auction/repository/RequestApprovalRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Page<RequestApproval> findRequestApprovalBySenderRole(
2121
Pageable pageable
2222
);
2323

24-
@Query("SELECT ra FROM RequestApproval ra WHERE ra.sender.role = 'MANAGER' AND ra.isConfirm = false AND ra.jewelry.user.id = :memberId AND ra.state = 'ACTIVE'")
25-
Page<RequestApproval> findRequestNeedConfirmByMember(@Param("memberId") Integer memberId, Pageable pageable);
24+
@Query("SELECT ra FROM RequestApproval ra WHERE ra.sender.role = 'MANAGER' AND ra.isConfirm = false AND ra.jewelry.user.id = :memberId AND ra.state = 'ACTIVE' AND (:jewelryName IS NULL OR ra.jewelry.name LIKE %:jewelryName%) ")
25+
Page<RequestApproval> findRequestNeedConfirmByMember(@Param("memberId") Integer memberId, @Param("jewelryName") String jewelryName, Pageable pageable);
2626

2727
@Query("SELECT ra FROM RequestApproval ra WHERE ra.sender.id = :id AND (:jewelryName IS NULL OR ra.jewelry.name LIKE %:jewelryName%)")
2828
Page<RequestApproval> findRequestApprovalByUserId(@Param("id") Integer id, @Param("jewelryName") String jewelryName,Pageable pageable);

src/main/java/vn/webapp/backend/auction/repository/TransactionRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface TransactionRepository extends JpaRepository<Transaction, Intege
2020

2121
@Query("SELECT t FROM Transaction t WHERE t.type = :typename " +
2222
"AND (:userName IS NULL OR CONCAT(t.user.firstName, ' ', t.user.lastName) LIKE %:userName%) " +
23-
"AND (:state IS NULL OR t.state = :state)")
23+
"AND ((:state IS NULL AND t.state <> 'HIDDEN') OR t.state = :state)")
2424
Page<Transaction> findTransactionByTypeAndState(
2525
@Param("typename") TransactionType typename,
2626
@Param("userName") String userName,

src/main/java/vn/webapp/backend/auction/repository/UserRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public interface UserRepository extends JpaRepository<User, Integer> {
7272
" u.bank_account_number, u.bank_id, u.city, u.district, " +
7373
" u.email, u.first_name, u.last_name, u.phone, u.password, " +
7474
" u.role, u.state, u.register_date, u.username, u.ward, u.year_of_birth, " +
75-
" u.cccd_first, u.cccd_last, u.cccd_from " +
75+
" u.cccd_first, u.cccd_last, u.cccd_from, u.ban_reason " +
7676
"ORDER BY SUM(t.total_price) DESC")
7777
List<User> findTopUsersByTotalSpent();
7878
}

src/main/java/vn/webapp/backend/auction/service/auction/AuctionService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import jakarta.mail.MessagingException;
44
import org.springframework.data.domain.Page;
55
import org.springframework.data.domain.Pageable;
6-
import vn.webapp.backend.auction.dto.AuctionRegistrationDTO;
6+
import vn.webapp.backend.auction.dto.AuctionRegistrationResponse;
77
import vn.webapp.backend.auction.dto.AuctionRequest;
88
import vn.webapp.backend.auction.enums.AuctionState;
99
import vn.webapp.backend.auction.model.Auction;
@@ -39,7 +39,7 @@ public interface AuctionService {
3939

4040
void deleteAuctionResult(Integer transactionId) throws MessagingException;
4141

42-
Page<AuctionRegistrationDTO> getAuctionRegistrations(AuctionState state, String auctionName, Pageable pageable);
42+
Page<AuctionRegistrationResponse> getAuctionRegistrations(AuctionState state, String auctionName, Pageable pageable);
4343

4444
Page<Auction> getAllFailedAuctions(Pageable pageable, String auctionName);
4545

src/main/java/vn/webapp/backend/auction/service/auction/AuctionServiceImpl.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.springframework.data.domain.PageImpl;
88
import org.springframework.data.domain.Pageable;
99
import org.springframework.stereotype.Service;
10-
import vn.webapp.backend.auction.dto.AuctionRegistrationDTO;
10+
import vn.webapp.backend.auction.dto.AuctionRegistrationResponse;
1111
import vn.webapp.backend.auction.dto.AuctionRequest;
1212
import vn.webapp.backend.auction.enums.AccountState;
1313
import vn.webapp.backend.auction.enums.AuctionState;
@@ -162,12 +162,13 @@ public void deleteAuctionResult(Integer transactionId) throws MessagingException
162162
var existingUser = userRepository.findById(userId)
163163
.orElseThrow(() -> new ResourceNotFoundException(ErrorMessages.USER_NOT_FOUND));
164164

165+
String reason = ReasonMessages.DO_NOT_PAY_ON_TIME;
165166
existingTransaction.setState(TransactionState.HIDDEN);
166167
existingAuction.setState(AuctionState.FINISHED);
167168
existingJewelry.setState(JewelryState.ACTIVE);
168169
existingUser.setState(AccountState.DISABLE);
170+
existingUser.setBanReason(reason);
169171

170-
String reason = ReasonMessages.DO_NOT_PAY_ON_TIME;
171172
emailService.sendBlockAccountEmail(
172173
existingUser.getEmail(),
173174
existingUser.getFullName(),
@@ -187,12 +188,12 @@ public Page<Auction> getAuctionsByStates(List<AuctionState> states, Pageable pag
187188
}
188189

189190
@Override
190-
public Page<AuctionRegistrationDTO> getAuctionRegistrations(AuctionState state, String auctionName, Pageable pageable) {
191+
public Page<AuctionRegistrationResponse> getAuctionRegistrations(AuctionState state, String auctionName, Pageable pageable) {
191192
List<Auction> auctions = auctionRepository.findByState(state, auctionName);
192-
List<AuctionRegistrationDTO> list = auctions.stream()
193+
List<AuctionRegistrationResponse> list = auctions.stream()
193194
.map(auction -> {
194195
Integer numberOfParticipants = auctionRegistrationRepository.countValidParticipantsByAuctionId(auction.getId());
195-
return new AuctionRegistrationDTO(
196+
return new AuctionRegistrationResponse(
196197
auction.getId(),
197198
auction.getName(),
198199
auction.getStartDate(),
@@ -201,12 +202,12 @@ public Page<AuctionRegistrationDTO> getAuctionRegistrations(AuctionState state,
201202
numberOfParticipants
202203
);
203204
})
204-
.sorted(Comparator.comparingInt(AuctionRegistrationDTO::numberOfParticipants).reversed())
205+
.sorted(Comparator.comparingInt(AuctionRegistrationResponse::numberOfParticipants).reversed())
205206
.collect(Collectors.toList());
206207

207208
int start = (int) pageable.getOffset();
208209
int end = Math.min((start + pageable.getPageSize()), list.size());
209-
List<AuctionRegistrationDTO> pagedAuctions = list.subList(start, end);
210+
List<AuctionRegistrationResponse> pagedAuctions = list.subList(start, end);
210211

211212
return new PageImpl<>(pagedAuctions , pageable, auctions.size());
212213
}

0 commit comments

Comments
 (0)