월별, 임산물 sql에러 수정

This commit is contained in:
주우성
2025-06-14 20:25:19 +09:00
parent c909821d5b
commit 944b9475b1
5 changed files with 86 additions and 122 deletions

View File

@@ -3,7 +3,18 @@ package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web;
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.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNotices;
import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNoticesCmd;
import app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model.GetMontylyssReqVO;
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;
@@ -12,14 +23,23 @@ import org.springframework.web.bind.annotation.GetMapping;
@RequiredArgsConstructor
class GetMontylysUIController {
private final GetHouseholdPortIn getHouseholdPortIn;
private final GetMonthlyInputStatussPortIn portIn;
@GetMapping(path = "/info/monthly")
String operate(Model model) {
String operate(Model model,
@PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable,
GetMontylyssReqVO reqVO) {
model.addAttribute("userInfo",
getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow());
Page<GetMonthlyInputStatuss> notices =
portIn.operate(
pageable,
new GetMonthlyInputStatussCmd(
reqVO.getSearchField(), reqVO.getSearchValue()));
model.addAttribute("reqVO", reqVO);
model.addAttribute("list", notices);
return "info/monthly/monthlys";
}
}

View File

@@ -0,0 +1,16 @@
package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@EqualsAndHashCode
public class GetMontylyssReqVO {
private String searchField;
private String searchValue;
}