260812_01_ENH: 배정·진행 현황 개선 및 예약/이벤트 이력 기능 추가
- 프로젝트별 외주사·필드워커 배정 현황 API 추가 - 진행 현황을 리스트 배정 기준으로 변경 및 미배정 집계 추가 - 마지막 이벤트 일자 필터·정렬 추가 - 예약 알림·기간 조회·확인 API 추가 - 이벤트 이력 단건 삭제 기능 추가 - 일반 리스트 헤더 ID를 101부터 생성 - 비밀번호 검증 규칙 완화
This commit is contained in:
@@ -8,14 +8,18 @@ import com.kri.contact.server.service.ReserveService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@@ -36,6 +40,26 @@ public class ReserveController {
|
||||
return reserveService.reserve(request, ctx.getUserId(), now);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserve notifications by user")
|
||||
@GetMapping("/user/{userId}")
|
||||
public List<ListReserveDto> findNotifications(
|
||||
@PathVariable String userId,
|
||||
@RequestParam(defaultValue = "false") boolean requestPast
|
||||
) {
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
return reserveService.findNotifications(userId, requestPast, now);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserves by user and date range")
|
||||
@GetMapping("/user/{userId}/search")
|
||||
public List<ListReserveDto> findByUserAndDateRange(
|
||||
@PathVariable String userId,
|
||||
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate fromDt,
|
||||
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate toDt
|
||||
) {
|
||||
return reserveService.findByUserAndDateRange(userId, fromDt, toDt);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserves by user")
|
||||
@GetMapping("/{prjctIdx}/user/{userId}")
|
||||
public List<ListReserveDto> findByUser(
|
||||
@@ -53,4 +77,13 @@ public class ReserveController {
|
||||
) {
|
||||
return reserveService.findBySid(prjctIdx, sid);
|
||||
}
|
||||
|
||||
@Operation(summary = "Confirm reserve notification")
|
||||
@PatchMapping("/confirm/{listResveIdx}")
|
||||
public void confirm(
|
||||
@PathVariable Long listResveIdx,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
reserveService.confirm(listResveIdx, ctx.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user