자동이체 기본
This commit is contained in:
@@ -10,12 +10,14 @@ import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.applic
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -28,35 +30,45 @@ class GetBanksUIController {
|
||||
|
||||
private final GetMonthlyInputStatussPortIn portIn;
|
||||
|
||||
@GetMapping(path = "/info/bank")
|
||||
String operate(Model model,
|
||||
@PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable
|
||||
) {
|
||||
@GetMapping(path = "/info/bank/{currentMonth}")
|
||||
String operateMonth(Model model, @PathVariable String currentMonth) {
|
||||
|
||||
Pageable pageable = PageRequest.of(
|
||||
0,
|
||||
13,
|
||||
Sort.by(Sort.Direction.DESC, "month")
|
||||
);
|
||||
|
||||
//TODO 사양 결정이 아직 안되 리스트 가져오는것과 오늘 날짜로 가져오는것 둘다
|
||||
Page<GetMonthlyInputStatuss> list =
|
||||
portIn.operate(
|
||||
pageable,
|
||||
new GetMonthlyInputStatussCmd(
|
||||
null, null, AuthUtil.getUserSeq()));
|
||||
|
||||
|
||||
model.addAttribute("list", list);
|
||||
|
||||
|
||||
String currentMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
|
||||
GetMonthlyInputStatuss matched = list.getContent().stream()
|
||||
GetMonthlyInputStatuss monthStatus = list.getContent().stream()
|
||||
.filter(item -> currentMonth.equals(item.getMonth()))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new NoSuchElementException("해당 월의 데이터가 없습니다."));
|
||||
|
||||
|
||||
|
||||
|
||||
model.addAttribute("monthStatus", monthStatus);
|
||||
|
||||
// TODO 페키지명이 넘무 길어서 그냥
|
||||
model.addAttribute("MonthStatus", MonthStatus.class);
|
||||
|
||||
return "info/bank/banks";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(path = "/info/bank")
|
||||
String operate() {
|
||||
|
||||
String currentMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
|
||||
return "redirect:/info/bank/" + currentMonth;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user