diff --git a/core/src/main/resources/mappers/household/UpdateFrontHouseholdMapper.xml b/core/src/main/resources/mappers/household/UpdateFrontHouseholdMapper.xml deleted file mode 100644 index 83bfe3b4..00000000 --- a/core/src/main/resources/mappers/household/UpdateFrontHouseholdMapper.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - UPDATE household - SET - owner_name = #{ownerName}, - owner_age = #{ownerAge}, - tel = #{tel}, - phone = #{phone}, - region_main_code = #{regionMainCode}, - region_sub_code = #{regionSubCode}, - address = #{address}, - - WHERE seq = ${seq} - - - \ No newline at end of file diff --git a/front/src/main/java/app/module/front/usecase/info/bankUI/getBanksUI/adapters/web/GetBanksUIController.java b/front/src/main/java/app/module/front/usecase/info/bankUI/getBanksUI/adapters/web/GetBanksUIController.java index 73a205da..067b01d0 100644 --- a/front/src/main/java/app/module/front/usecase/info/bankUI/getBanksUI/adapters/web/GetBanksUIController.java +++ b/front/src/main/java/app/module/front/usecase/info/bankUI/getBanksUI/adapters/web/GetBanksUIController.java @@ -1,24 +1,61 @@ package app.module.front.usecase.info.bankUI.getBanksUI.adapters.web; +import app.module.core.config.application.enums.MonthStatus; import app.module.core.config.application.util.CommonUtil; import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn; import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd; +import app.module.front.config.application.util.AuthUtil; +import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn; +import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss; +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.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 java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.NoSuchElementException; + @Controller @RequiredArgsConstructor class GetBanksUIController { - private final GetHouseholdPortIn getHouseholdPortIn; + + private final GetMonthlyInputStatussPortIn portIn; @GetMapping(path = "/info/bank") - String operate(Model model) { + String operate(Model model, + @PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable + ) { - model.addAttribute("userInfo", - getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow()); + //TODO 사양 결정이 아직 안되 리스트 가져오는것과 오늘 날짜로 가져오는것 둘다 + Page 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() + .filter(item -> currentMonth.equals(item.getMonth())) + .findFirst() + .orElseThrow(() -> new NoSuchElementException("해당 월의 데이터가 없습니다.")); + + + + + + // TODO 페키지명이 넘무 길어서 그냥 + model.addAttribute("MonthStatus", MonthStatus.class); return "info/bank/banks"; } diff --git a/core/src/main/resources/mappers/notice/CreateNoticeMapper.xml b/front/src/main/resources/mappers/notice/CreateNoticeMapper.xml similarity index 100% rename from core/src/main/resources/mappers/notice/CreateNoticeMapper.xml rename to front/src/main/resources/mappers/notice/CreateNoticeMapper.xml diff --git a/core/src/main/resources/mappers/notice/GetNoticeMapper.xml b/front/src/main/resources/mappers/notice/GetNoticeMapper.xml similarity index 100% rename from core/src/main/resources/mappers/notice/GetNoticeMapper.xml rename to front/src/main/resources/mappers/notice/GetNoticeMapper.xml diff --git a/core/src/main/resources/mappers/notice/GetNoticesMapper.xml b/front/src/main/resources/mappers/notice/GetNoticesMapper.xml similarity index 100% rename from core/src/main/resources/mappers/notice/GetNoticesMapper.xml rename to front/src/main/resources/mappers/notice/GetNoticesMapper.xml diff --git a/core/src/main/resources/mappers/notice/RemoveNoticesMapper.xml b/front/src/main/resources/mappers/notice/RemoveNoticesMapper.xml similarity index 100% rename from core/src/main/resources/mappers/notice/RemoveNoticesMapper.xml rename to front/src/main/resources/mappers/notice/RemoveNoticesMapper.xml diff --git a/core/src/main/resources/mappers/notice/UpdateNoticeMapper.xml b/front/src/main/resources/mappers/notice/UpdateNoticeMapper.xml similarity index 100% rename from core/src/main/resources/mappers/notice/UpdateNoticeMapper.xml rename to front/src/main/resources/mappers/notice/UpdateNoticeMapper.xml diff --git a/front/src/main/resources/mappers/user/GetUserMapper.xml b/front/src/main/resources/mappers/userFront/GetUserMapper.xml similarity index 100% rename from front/src/main/resources/mappers/user/GetUserMapper.xml rename to front/src/main/resources/mappers/userFront/GetUserMapper.xml diff --git a/front/src/main/resources/mappers/user/UpdateUserMapper.xml b/front/src/main/resources/mappers/userFront/UpdateUserMapper.xml similarity index 100% rename from front/src/main/resources/mappers/user/UpdateUserMapper.xml rename to front/src/main/resources/mappers/userFront/UpdateUserMapper.xml