|
@@ -80,4 +80,28 @@ public class ReservationController {
|
|
public void deleteReservation(@PathVariable("id") @Min(value = 1, message = "预约主键不能小于1") Long id) {
|
|
public void deleteReservation(@PathVariable("id") @Min(value = 1, message = "预约主键不能小于1") Long id) {
|
|
this.reservationService.deleteReservation(id);
|
|
this.reservationService.deleteReservation(id);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询商家被预约列表
|
|
|
|
+ *
|
|
|
|
+ * @param param 查询参数
|
|
|
|
+ * @return 商家被预约列表
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/listMerchantReservations")
|
|
|
|
+ public List<ReservationVO> listMerchantReservations(@RequestBody @Valid ReservationQueryParam param) {
|
|
|
|
+ List<ReservationDTO> reservations = this.reservationService.listMerchantReservations(param);
|
|
|
|
+ if (CollectionUtils.isEmpty(reservations)) {
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
+ }
|
|
|
|
+ return reservations
|
|
|
|
+ .stream()
|
|
|
|
+ .map(o -> {
|
|
|
|
+ ReservationVO reservationVO = ReservationCopier.INSTANCE.copying(o);
|
|
|
|
+ reservationVO.setSimpleMerchantVO(MerchantCopier.INSTANCE
|
|
|
|
+ .merchantDTOToSimpleMerchantVO(o.getMerchant()));
|
|
|
|
+ return reservationVO;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ }
|
|
}
|
|
}
|