feat: 优化预约时段服务
This commit is contained in:
parent
e4410f5794
commit
418dbb5801
@ -18,7 +18,7 @@ public class AppointmentController {
|
|||||||
private final AppointmentService appointmentService;
|
private final AppointmentService appointmentService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门店某日可预约时段(半小时一档,医院挂号式占号)。
|
* 门店某日可预约时段(半小时一档,每档最多一单)。
|
||||||
* date 格式:yyyy-MM-dd
|
* date 格式:yyyy-MM-dd
|
||||||
*/
|
*/
|
||||||
@GetMapping("/available-slots")
|
@GetMapping("/available-slots")
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public class AppointmentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 某门店某日:半小时挂号时段列表(已占用 / 已过 / 可约)。
|
* 某门店某日:半小时预约档列表(已占用 / 已过 / 可约)。
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> availableSlots(Long storeId, LocalDate date) {
|
public Map<String, Object> availableSlots(Long storeId, LocalDate date) {
|
||||||
if (storeId == null || date == null) {
|
if (storeId == null || date == null) {
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public final class AppointmentSlotSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在给定放号窗口内,生成某日所有半点起始时刻(含首尾)。
|
* 在给定可预约时间窗口内,生成某日所有半点起始时刻(含首尾)。
|
||||||
*/
|
*/
|
||||||
public static List<LocalDateTime> allSlotStartsOnDay(LocalDate date, StoreBookingWindow window) {
|
public static List<LocalDateTime> allSlotStartsOnDay(LocalDate date, StoreBookingWindow window) {
|
||||||
List<LocalDateTime> list = new ArrayList<>();
|
List<LocalDateTime> list = new ArrayList<>();
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import com.petstore.entity.Store;
|
|||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 门店可预约放号窗口(半小时一档的首末时刻)。
|
* 门店线上可预约时间窗口(半小时一档的首末时刻)。
|
||||||
*/
|
*/
|
||||||
public record StoreBookingWindow(LocalTime dayStart, LocalTime lastSlotStart) {
|
public record StoreBookingWindow(LocalTime dayStart, LocalTime lastSlotStart) {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user