ProductController getDetail메서드 수정. detailVo에서 productDto로 변경

ProductService getProduct 수정. detailVo에서 productDto로 변경

IProductMapper 에서 selectProductStock 메서드 작성

xml 작성. 이 상품의 재고를 반환해주는 것.

ProductService 기존 getProduct의 매개변수 detailVo를 productDto로 변경

productDto는 result값이 없다.
getProduct 그대로 복사 DetailVo로 하나 더

detail.html에서 detailVo를 productDto로 이름 변경


xml 실행해보면 현재 null이 뜬다.

IFNULL을 사용하여 방지 0 처리

detail.html 에 두 내용 추가
<title th:text="${'쿠팡 ! - ' + (productDto.getTitle() == null ? '존재하지 않는 상품' : productDto.getTitle())}"></title>
<section th:class="${productDto.getCount() == 0 ? 'right sold-out' : 'right'}">
detail.css


일시 품절도 추가

not-allowed 속성 추가


onclick 추가, button-container 이름은 stock-container로 변경

기존 css에 button-container 추가해주기


table 추가

detail.html에 post 추가

입출고 내역 저장 버튼 클릭해보면

ProductController

IProductMapper

xml

ProductService

ProductController

ProductService

IProductMapper 에서 selectStocks

xml

ProductService

ProductController

detail.html
테이블 추가