├── VamPa ├── .gitignore ├── Blog_Project │ └── VamPa │ │ └── target │ │ └── m2e-wtp │ │ └── web-resources │ │ └── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ └── com.vam │ │ └── controller │ │ ├── pom.properties │ │ └── pom.xml ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── vam │ │ │ │ ├── controller │ │ │ │ ├── AdminController.java │ │ │ │ ├── BookController.java │ │ │ │ ├── CartController.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── MemberController.java │ │ │ │ ├── OrderController.java │ │ │ │ └── ReplyController.java │ │ │ │ ├── interceptor │ │ │ │ ├── AdminInterceptor.java │ │ │ │ ├── CartInterceptor.java │ │ │ │ └── LoginInterceptor.java │ │ │ │ ├── mapper │ │ │ │ ├── AdminMapper.java │ │ │ │ ├── AttachMapper.java │ │ │ │ ├── AuthorMapper.java │ │ │ │ ├── BookMapper.java │ │ │ │ ├── CartMapper.java │ │ │ │ ├── MemberMapper.java │ │ │ │ ├── OrderMapper.java │ │ │ │ └── ReplyMapper.java │ │ │ │ ├── model │ │ │ │ ├── AttachImageVO.java │ │ │ │ ├── AuthorVO.java │ │ │ │ ├── BookVO.java │ │ │ │ ├── CartDTO.java │ │ │ │ ├── CateFilterDTO.java │ │ │ │ ├── CateVO.java │ │ │ │ ├── Criteria.java │ │ │ │ ├── MemberVO.java │ │ │ │ ├── OrderCancelDTO.java │ │ │ │ ├── OrderDTO.java │ │ │ │ ├── OrderItemDTO.java │ │ │ │ ├── OrderPageDTO.java │ │ │ │ ├── OrderPageItemDTO.java │ │ │ │ ├── PageDTO.java │ │ │ │ ├── ReplyDTO.java │ │ │ │ ├── ReplyPageDTO.java │ │ │ │ ├── SelectDTO.java │ │ │ │ └── UpdateReplyDTO.java │ │ │ │ ├── sample │ │ │ │ ├── Chef.java │ │ │ │ └── Restaurant.java │ │ │ │ ├── service │ │ │ │ ├── AdminService.java │ │ │ │ ├── AdminServiceImpl.java │ │ │ │ ├── AttachService.java │ │ │ │ ├── AttachServiceImpl.java │ │ │ │ ├── AuthorService.java │ │ │ │ ├── AuthorServiceImpl.java │ │ │ │ ├── BookService.java │ │ │ │ ├── BookServiceImpl.java │ │ │ │ ├── CartService.java │ │ │ │ ├── CartServiceImpl.java │ │ │ │ ├── MemberService.java │ │ │ │ ├── MemberServiceImpl.java │ │ │ │ ├── OrderService.java │ │ │ │ ├── OrderServiceImpl.java │ │ │ │ ├── ReplyService.java │ │ │ │ └── ReplyServiceImpl.java │ │ │ │ └── task │ │ │ │ ├── AttachFileCheckTask.java │ │ │ │ └── testBatch.java │ │ ├── resources │ │ │ ├── com │ │ │ │ └── vam │ │ │ │ │ └── mapper │ │ │ │ │ ├── AdminMapper.xml │ │ │ │ │ ├── AttachMapper.xml │ │ │ │ │ ├── AuthorMapper.xml │ │ │ │ │ ├── BookMapper.xml │ │ │ │ │ ├── CartMapper.xml │ │ │ │ │ ├── MemberMapper.xml │ │ │ │ │ ├── OrderMapper.xml │ │ │ │ │ └── ReplyMapper.xml │ │ │ ├── log4j.xml │ │ │ └── log4jdbc.log4j2.properties │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── spring │ │ │ │ ├── appServlet │ │ │ │ │ ├── security-context.xml │ │ │ │ │ └── servlet-context.xml │ │ │ │ └── root-context.xml │ │ │ ├── views │ │ │ │ ├── admin │ │ │ │ │ ├── authorDetail.jsp │ │ │ │ │ ├── authorEnroll.jsp │ │ │ │ │ ├── authorManage.jsp │ │ │ │ │ ├── authorModify.jsp │ │ │ │ │ ├── authorPop.jsp │ │ │ │ │ ├── goodsDetail.jsp │ │ │ │ │ ├── goodsEnroll.jsp │ │ │ │ │ ├── goodsManage.jsp │ │ │ │ │ ├── goodsModify.jsp │ │ │ │ │ ├── main.jsp │ │ │ │ │ └── orderList.jsp │ │ │ │ ├── cart.jsp │ │ │ │ ├── goodsDetail.jsp │ │ │ │ ├── home.jsp │ │ │ │ ├── includes │ │ │ │ │ └── admin │ │ │ │ │ │ ├── footer.jsp │ │ │ │ │ │ └── header.jsp │ │ │ │ ├── main.jsp │ │ │ │ ├── member │ │ │ │ │ ├── join.jsp │ │ │ │ │ └── login.jsp │ │ │ │ ├── order.jsp │ │ │ │ ├── replyEnroll.jsp │ │ │ │ ├── replyUpdate.jsp │ │ │ │ └── search.jsp │ │ │ └── web.xml │ │ │ └── resources │ │ │ ├── css │ │ │ ├── admin │ │ │ │ ├── authorDetail.css │ │ │ │ ├── authorEnroll.css │ │ │ │ ├── authorManage.css │ │ │ │ ├── authorModify.css │ │ │ │ ├── authorPop.css │ │ │ │ ├── goodsDetail.css │ │ │ │ ├── goodsEnroll.css │ │ │ │ ├── goodsManage.css │ │ │ │ ├── goodsModify.css │ │ │ │ ├── main.css │ │ │ │ └── orderList.css │ │ │ ├── cart.css │ │ │ ├── goodsDetail.css │ │ │ ├── main.css │ │ │ ├── member │ │ │ │ ├── join.css │ │ │ │ └── login.css │ │ │ ├── order.css │ │ │ └── search.css │ │ │ └── img │ │ │ ├── Logo.png │ │ │ ├── bnA_w01_a8daff.jpg │ │ │ ├── bnD_w01_c3c5f7.jpg │ │ │ ├── bnK_w01_c3c5f7.jpg │ │ │ ├── goodsNoImage.png │ │ │ └── mLogo.png │ └── test │ │ ├── java │ │ └── com │ │ │ └── vam │ │ │ ├── mapper │ │ │ ├── AdminMapperTests.java │ │ │ ├── AttachMapperTests.java │ │ │ ├── AuthorMapperTests.java │ │ │ ├── BookMapperTests.java │ │ │ ├── CartMapperTests.java │ │ │ ├── MemberMapperTests.java │ │ │ ├── OrderMapperTests.java │ │ │ └── ReplyMapperTests.java │ │ │ ├── persistence │ │ │ └── JDBCTests.java │ │ │ ├── sample │ │ │ ├── DataSourceTests.java │ │ │ └── SampleTests.java │ │ │ ├── service │ │ │ ├── AdminServiceTests.java │ │ │ ├── AuthorServiceTests.java │ │ │ ├── BookServiceTests.java │ │ │ └── CartServiceTests.java │ │ │ └── task │ │ │ └── TaskTest.java │ │ └── resources │ │ └── log4j.xml └── target │ ├── classes │ ├── com │ │ └── vam │ │ │ └── mapper │ │ │ ├── AdminMapper.xml │ │ │ ├── AttachMapper.xml │ │ │ ├── AuthorMapper.xml │ │ │ ├── BookMapper.xml │ │ │ ├── CartMapper.xml │ │ │ ├── MemberMapper.xml │ │ │ ├── OrderMapper.xml │ │ │ └── ReplyMapper.xml │ ├── log4j.xml │ └── log4jdbc.log4j2.properties │ ├── m2e-wtp │ └── web-resources │ │ └── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ └── com.vam │ │ └── controller │ │ ├── pom.properties │ │ └── pom.xml │ └── test-classes │ └── log4j.xml └── VamPa_MySQL ├── .gitignore ├── Blog_Project └── VamPa_MySQL │ └── target │ └── m2e-wtp │ └── web-resources │ └── META-INF │ ├── MANIFEST.MF │ └── maven │ └── com.vam │ └── controller │ ├── pom.properties │ └── pom.xml ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── vam │ │ │ ├── controller │ │ │ ├── AdminController.java │ │ │ ├── BookController.java │ │ │ ├── CartController.java │ │ │ ├── HomeController.java │ │ │ ├── MemberController.java │ │ │ ├── OrderController.java │ │ │ └── ReplyController.java │ │ │ ├── interceptor │ │ │ ├── AdminInterceptor.java │ │ │ ├── CartInterceptor.java │ │ │ └── LoginInterceptor.java │ │ │ ├── mapper │ │ │ ├── AdminMapper.java │ │ │ ├── AttachMapper.java │ │ │ ├── AuthorMapper.java │ │ │ ├── BookMapper.java │ │ │ ├── CartMapper.java │ │ │ ├── MemberMapper.java │ │ │ ├── OrderMapper.java │ │ │ └── ReplyMapper.java │ │ │ ├── model │ │ │ ├── AttachImageVO.java │ │ │ ├── AuthorVO.java │ │ │ ├── BookVO.java │ │ │ ├── CartDTO.java │ │ │ ├── CateFilterDTO.java │ │ │ ├── CateVO.java │ │ │ ├── Criteria.java │ │ │ ├── MemberVO.java │ │ │ ├── OrderCancelDTO.java │ │ │ ├── OrderDTO.java │ │ │ ├── OrderItemDTO.java │ │ │ ├── OrderPageDTO.java │ │ │ ├── OrderPageItemDTO.java │ │ │ ├── PageDTO.java │ │ │ ├── ReplyDTO.java │ │ │ ├── ReplyPageDTO.java │ │ │ ├── SelectDTO.java │ │ │ └── UpdateReplyDTO.java │ │ │ ├── sample │ │ │ ├── Chef.java │ │ │ └── Restaurant.java │ │ │ └── service │ │ │ ├── AdminService.java │ │ │ ├── AdminServiceImpl.java │ │ │ ├── AttachService.java │ │ │ ├── AttachServiceImpl.java │ │ │ ├── AuthorService.java │ │ │ ├── AuthorServiceImpl.java │ │ │ ├── BookService.java │ │ │ ├── BookServiceImpl.java │ │ │ ├── CartService.java │ │ │ ├── CartServiceImpl.java │ │ │ ├── MemberService.java │ │ │ ├── MemberServiceImpl.java │ │ │ ├── OrderService.java │ │ │ ├── OrderServiceImpl.java │ │ │ ├── ReplyService.java │ │ │ └── ReplyServiceImpl.java │ ├── resources │ │ ├── com │ │ │ └── vam │ │ │ │ └── mapper │ │ │ │ ├── AdminMapper.xml │ │ │ │ ├── AttachMapper.xml │ │ │ │ ├── AuthorMapper.xml │ │ │ │ ├── BookMapper.xml │ │ │ │ ├── CartMapper.xml │ │ │ │ ├── MemberMapper.xml │ │ │ │ ├── OrderMapper.xml │ │ │ │ └── ReplyMapper.xml │ │ ├── log4j.xml │ │ └── log4jdbc.log4j2.properties │ └── webapp │ │ ├── WEB-INF │ │ ├── spring │ │ │ ├── appServlet │ │ │ │ ├── security-context.xml │ │ │ │ └── servlet-context.xml │ │ │ └── root-context.xml │ │ ├── views │ │ │ ├── admin │ │ │ │ ├── authorDetail.jsp │ │ │ │ ├── authorEnroll.jsp │ │ │ │ ├── authorManage.jsp │ │ │ │ ├── authorModify.jsp │ │ │ │ ├── authorPop.jsp │ │ │ │ ├── goodsDetail.jsp │ │ │ │ ├── goodsEnroll.jsp │ │ │ │ ├── goodsManage.jsp │ │ │ │ ├── goodsModify.jsp │ │ │ │ ├── main.jsp │ │ │ │ └── orderList.jsp │ │ │ ├── cart.jsp │ │ │ ├── goodsDetail.jsp │ │ │ ├── home.jsp │ │ │ ├── includes │ │ │ │ └── admin │ │ │ │ │ ├── footer.jsp │ │ │ │ │ └── header.jsp │ │ │ ├── main.jsp │ │ │ ├── member │ │ │ │ ├── join.jsp │ │ │ │ └── login.jsp │ │ │ ├── order.jsp │ │ │ ├── replyEnroll.jsp │ │ │ ├── replyUpdate.jsp │ │ │ └── search.jsp │ │ └── web.xml │ │ └── resources │ │ ├── css │ │ ├── admin │ │ │ ├── authorDetail.css │ │ │ ├── authorEnroll.css │ │ │ ├── authorManage.css │ │ │ ├── authorModify.css │ │ │ ├── authorPop.css │ │ │ ├── goodsDetail.css │ │ │ ├── goodsEnroll.css │ │ │ ├── goodsManage.css │ │ │ ├── goodsModify.css │ │ │ ├── main.css │ │ │ └── orderList.css │ │ ├── cart.css │ │ ├── main.css │ │ ├── member │ │ │ ├── join.css │ │ │ └── login.css │ │ ├── order.css │ │ └── search.css │ │ ├── goodsDetail.css │ │ └── img │ │ ├── Logo.png │ │ ├── bnA_w01_a8daff.jpg │ │ ├── bnD_w01_c3c5f7.jpg │ │ ├── bnK_w01_c3c5f7.jpg │ │ ├── goodsNoImage.png │ │ └── mLogo.png └── test │ ├── java │ └── com │ │ └── vam │ │ ├── mapper │ │ ├── AdminMapperTests.java │ │ ├── AttachMapperTests.java │ │ ├── AuthorMapperTests.java │ │ ├── BookMapperTests.java │ │ ├── CartMapperTests.java │ │ └── MemberMapperTests.java │ │ ├── persistence │ │ ├── DataSourceTests.java │ │ └── JDBCTests.java │ │ ├── sample │ │ └── SampleTests.java │ │ ├── service │ │ ├── AdminServiceTests.java │ │ ├── AuthorServiceTests.java │ │ ├── BookServiceTests.java │ │ └── CartServiceTests.java │ │ └── task │ │ └── AttachFileCheckTask.java │ └── resources │ └── log4j.xml └── target ├── classes ├── com │ └── vam │ │ └── mapper │ │ ├── AdminMapper.xml │ │ ├── AttachMapper.xml │ │ ├── AuthorMapper.xml │ │ ├── BookMapper.xml │ │ ├── CartMapper.xml │ │ ├── MemberMapper.xml │ │ ├── OrderMapper.xml │ │ └── ReplyMapper.xml ├── log4j.xml └── log4jdbc.log4j2.properties ├── m2e-wtp └── web-resources │ └── META-INF │ ├── MANIFEST.MF │ └── maven │ └── com.vam │ └── controller │ ├── pom.properties │ └── pom.xml └── test-classes └── log4j.xml /VamPa/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/java,windows,eclipse 3 | # Edit at https://www.gitignore.io/?templates=java,windows,eclipse 4 | 5 | ### Eclipse ### 6 | .metadata 7 | bin/ 8 | tmp/ 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | local.properties 14 | .settings/ 15 | .loadpath 16 | .recommenders 17 | 18 | # External tool builders 19 | .externalToolBuilders/ 20 | 21 | # Locally stored "Eclipse launch configurations" 22 | *.launch 23 | 24 | # PyDev specific (Python IDE for Eclipse) 25 | *.pydevproject 26 | 27 | # CDT-specific (C/C++ Development Tooling) 28 | .cproject 29 | 30 | # CDT- autotools 31 | .autotools 32 | 33 | # Java annotation processor (APT) 34 | .factorypath 35 | 36 | # PDT-specific (PHP Development Tools) 37 | .buildpath 38 | 39 | # sbteclipse plugin 40 | .target 41 | 42 | # Tern plugin 43 | .tern-project 44 | 45 | # TeXlipse plugin 46 | .texlipse 47 | 48 | # STS (Spring Tool Suite) 49 | .springBeans 50 | 51 | # Code Recommenders 52 | .recommenders/ 53 | 54 | # Annotation Processing 55 | .apt_generated/ 56 | 57 | # Scala IDE specific (Scala & Java development for Eclipse) 58 | .cache-main 59 | .scala_dependencies 60 | .worksheet 61 | 62 | ### Eclipse Patch ### 63 | # Eclipse Core 64 | .project 65 | 66 | # JDT-specific (Eclipse Java Development Tools) 67 | .classpath 68 | 69 | # Annotation Processing 70 | .apt_generated 71 | 72 | .sts4-cache/ 73 | 74 | ### Java ### 75 | # Compiled class file 76 | *.class 77 | 78 | # Log file 79 | *.log 80 | 81 | # BlueJ files 82 | *.ctxt 83 | 84 | # Mobile Tools for Java (J2ME) 85 | .mtj.tmp/ 86 | 87 | # Package Files # 88 | *.jar 89 | *.war 90 | *.nar 91 | *.ear 92 | *.zip 93 | *.tar.gz 94 | *.rar 95 | 96 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 97 | hs_err_pid* 98 | 99 | ### Windows ### 100 | # Windows thumbnail cache files 101 | Thumbs.db 102 | Thumbs.db:encryptable 103 | ehthumbs.db 104 | ehthumbs_vista.db 105 | 106 | # Dump file 107 | *.stackdump 108 | 109 | # Folder config file 110 | [Dd]esktop.ini 111 | 112 | # Recycle Bin used on file shares 113 | $RECYCLE.BIN/ 114 | 115 | # Windows Installer files 116 | *.cab 117 | *.msi 118 | *.msix 119 | *.msm 120 | *.msp 121 | 122 | # Windows shortcuts 123 | *.lnk 124 | 125 | # End of https://www.gitignore.io/api/java,windows,eclipse -------------------------------------------------------------------------------- /VamPa/Blog_Project/VamPa/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: sjinj 3 | Build-Jdk: 1.8.0_221 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /VamPa/Blog_Project/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Fri Aug 07 23:18:00 KST 2020 3 | version=1.0.0-BUILD-SNAPSHOT 4 | groupId=com.vam 5 | m2e.projectName=VamPa 6 | m2e.projectLocation=C\:\\Users\\sjinj\\git\\blog_project\\VamPa 7 | artifactId=controller 8 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/controller/CartController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.vam.model.CartDTO; 15 | import com.vam.model.MemberVO; 16 | import com.vam.service.CartService; 17 | 18 | @Controller 19 | public class CartController { 20 | 21 | @Autowired 22 | private CartService cartService; 23 | 24 | 25 | /* 장바구니 추가 */ 26 | /** 27 | * 0: 등록 실패 28 | * 1: 등록 성공 29 | * 2: 등록된 데이터 존재 30 | * 5: 로그인 필요 31 | * 32 | */ 33 | @PostMapping("/cart/add") 34 | @ResponseBody 35 | public String addCartPOST(CartDTO cart, HttpServletRequest request) { 36 | // 로그인 체크 37 | HttpSession session = request.getSession(); 38 | MemberVO mvo = (MemberVO)session.getAttribute("member"); 39 | if(mvo == null) { 40 | return "5"; 41 | } 42 | 43 | // 카트 등록 44 | 45 | int result = cartService.addCart(cart); 46 | 47 | return result + ""; 48 | } 49 | 50 | /* 장바구니 페이지 이동 */ 51 | @GetMapping("/cart/{memberId}") 52 | public String cartPageGET(@PathVariable("memberId") String memberId, Model model) { 53 | 54 | model.addAttribute("cartInfo", cartService.getCartList(memberId)); 55 | 56 | return "/cart"; 57 | } 58 | 59 | /* 장바구니 수량 수정 */ 60 | @PostMapping("/cart/update") 61 | public String updateCartPOST(CartDTO cart) { 62 | 63 | cartService.modifyCount(cart); 64 | 65 | return "redirect:/cart/" + cart.getMemberId(); 66 | 67 | } 68 | 69 | /* 장바구니 수량 수정 */ 70 | @PostMapping("/cart/delete") 71 | public String deleteCartPOST(CartDTO cart) { 72 | 73 | cartService.deleteCart(cart.getCartId()); 74 | 75 | return "redirect:/cart/" + cart.getMemberId(); 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import java.text.DateFormat; 4 | import java.util.Date; 5 | import java.util.Locale; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | 14 | /** 15 | * Handles requests for the application home page. 16 | */ 17 | @Controller 18 | public class HomeController { 19 | 20 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 21 | 22 | /** 23 | * Simply selects the home view to render by returning its name. 24 | */ 25 | @RequestMapping(value = "/", method = RequestMethod.GET) 26 | public String home(Locale locale, Model model) { 27 | logger.info("Welcome home! The client locale is {}.", locale); 28 | 29 | Date date = new Date(); 30 | DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); 31 | 32 | String formattedDate = dateFormat.format(date); 33 | 34 | model.addAttribute("serverTime", formattedDate ); 35 | 36 | return "home"; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | 13 | import com.vam.model.MemberVO; 14 | import com.vam.model.OrderDTO; 15 | import com.vam.model.OrderPageDTO; 16 | import com.vam.service.MemberService; 17 | import com.vam.service.OrderService; 18 | 19 | @Controller 20 | public class OrderController { 21 | 22 | @Autowired 23 | private OrderService orderService; 24 | 25 | @Autowired 26 | private MemberService memberService; 27 | 28 | @GetMapping("/order/{memberId}") 29 | public String orderPgaeGET(@PathVariable("memberId") String memberId, OrderPageDTO opd, Model model) { 30 | 31 | model.addAttribute("orderList", orderService.getGoodsInfo(opd.getOrders())); 32 | model.addAttribute("memberInfo", memberService.getMemberInfo(memberId)); 33 | 34 | 35 | return "/order"; 36 | } 37 | 38 | @PostMapping("/order") 39 | public String orderPagePost(OrderDTO od, HttpServletRequest request) { 40 | 41 | System.out.println(od); 42 | 43 | orderService.order(od); 44 | 45 | MemberVO member = new MemberVO(); 46 | member.setMemberId(od.getMemberId()); 47 | 48 | HttpSession session = request.getSession(); 49 | 50 | try { 51 | MemberVO memberLogin = memberService.memberLogin(member); 52 | memberLogin.setMemberPw(""); 53 | session.setAttribute("member", memberLogin); 54 | 55 | } catch (Exception e) { 56 | 57 | e.printStackTrace(); 58 | } 59 | 60 | return "redirect:/main"; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/controller/ReplyController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.MediaType; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import com.vam.model.Criteria; 11 | import com.vam.model.ReplyDTO; 12 | import com.vam.model.ReplyPageDTO; 13 | import com.vam.service.ReplyService; 14 | 15 | @RestController 16 | @RequestMapping("/reply") 17 | public class ReplyController { 18 | 19 | @Autowired 20 | private ReplyService replyService; 21 | 22 | /* 댓글 등록 */ 23 | @PostMapping("/enroll") 24 | public void enrollReplyPOST(ReplyDTO dto) { 25 | replyService.enrollReply(dto); 26 | } 27 | 28 | /* 댓글 체크 */ 29 | /* memberId, bookId 파라미터 */ 30 | /* 존재 : 1 / 존재x : 0 */ 31 | @PostMapping("/check") 32 | public String replyCheckPOST(ReplyDTO dto) { 33 | return replyService.checkReply(dto); 34 | } 35 | 36 | /* 댓글 페이징 */ 37 | @GetMapping(value="/list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 38 | public ReplyPageDTO replyListPOST(Criteria cri) { 39 | return replyService.replyList(cri); 40 | } 41 | 42 | /* 댓글 수정 */ 43 | @PostMapping("/update") 44 | public void replyModifyPOST(ReplyDTO dto) { 45 | replyService.updateReply(dto); 46 | } 47 | 48 | /* 댓글 삭제 */ 49 | @PostMapping("/delete") 50 | public void replyDeletePOST(ReplyDTO dto) { 51 | replyService.deleteReply(dto); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/interceptor/AdminInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vam.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | 9 | import com.vam.model.MemberVO; 10 | 11 | public class AdminInterceptor implements HandlerInterceptor { 12 | 13 | @Override 14 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 15 | throws Exception { 16 | 17 | HttpSession session = request.getSession(); 18 | 19 | MemberVO lvo = (MemberVO)session.getAttribute("member"); 20 | 21 | if(lvo == null || lvo.getAdminCk() == 0) { // 관리자 계정 아닌 경우 22 | 23 | response.sendRedirect("/main"); // 메인페이지로 리다이렉트 24 | 25 | return false; 26 | 27 | } 28 | 29 | return true; // 관리자 계정 로그인 경우(lvo != null && lvo.getAdminCk() == 1) 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/interceptor/CartInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vam.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | 9 | import com.vam.model.MemberVO; 10 | 11 | public class CartInterceptor implements HandlerInterceptor{ 12 | 13 | @Override 14 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 15 | throws Exception { 16 | 17 | HttpSession session = request.getSession(); 18 | 19 | MemberVO mvo = (MemberVO)session.getAttribute("member"); 20 | 21 | if(mvo == null) { 22 | response.sendRedirect("/main"); 23 | return false; 24 | } else { 25 | return true; 26 | } 27 | 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vam.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | 9 | 10 | public class LoginInterceptor implements HandlerInterceptor{ 11 | 12 | @Override 13 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 14 | throws Exception { 15 | 16 | System.out.println("LoginInterceptor preHandle 작동"); 17 | 18 | HttpSession session = request.getSession(); 19 | 20 | session.invalidate(); 21 | 22 | return true; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | import com.vam.model.BookVO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.OrderDTO; 10 | 11 | public interface AdminMapper { 12 | 13 | /* 상품 등록 */ 14 | public void bookEnroll(BookVO book); 15 | 16 | /* 카테고리 리스트 */ 17 | public List cateList(); 18 | 19 | /* 상품 리스트 */ 20 | public List goodsGetList(Criteria cri); 21 | 22 | /* 상품 총 개수 */ 23 | public int goodsGetTotal(Criteria cri); 24 | 25 | /* 상품 조회 페이지 */ 26 | public BookVO goodsGetDetail(int bookId); 27 | 28 | /* 상품 수정 */ 29 | public int goodsModify(BookVO vo); 30 | 31 | /* 상품 정보 삭제 */ 32 | public int goodsDelete(int bookId); 33 | 34 | /* 이미지 등록 */ 35 | public void imageEnroll(AttachImageVO vo); 36 | 37 | /* 지정 상품 이미지 전체 삭제 */ 38 | public void deleteImageAll(int bookId); 39 | 40 | /* 어제자 날짜 이미지 리스트 */ 41 | public List checkFileList(); 42 | 43 | /* 지정 상품 이미지 정보 얻기 */ 44 | public List getAttachInfo(int bookId); 45 | 46 | /* 주문 상품 리스트 */ 47 | public List getOrderList(Criteria cri); 48 | 49 | /* 주문 총 갯수 */ 50 | public int getOrderTotal(Criteria cri); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/AttachMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | 7 | public interface AttachMapper { 8 | 9 | /* 이미지 데이터 반환 */ 10 | public List getAttachList(int bookId); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/AuthorMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AuthorVO; 6 | import com.vam.model.Criteria; 7 | 8 | public interface AuthorMapper { 9 | 10 | /* 작가 등록 */ 11 | public void authorEnroll(AuthorVO author); 12 | 13 | /* 작가 목록 */ 14 | public List authorGetList(Criteria cri); 15 | 16 | /* 작가 총 수 */ 17 | public int authorGetTotal(Criteria cri); 18 | 19 | /* 작가 상세 */ 20 | public AuthorVO authorGetDetail(int authorId); 21 | 22 | /* 작가 정보 수정 */ 23 | public int authorModify(AuthorVO author); 24 | 25 | /* 작가 정보 삭제 */ 26 | public int authorDelete(int authorId); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/BookMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.BookVO; 6 | import com.vam.model.CateFilterDTO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.SelectDTO; 10 | 11 | public interface BookMapper { 12 | 13 | /* 상품 검색 */ 14 | public List getGoodsList(Criteria cri); 15 | 16 | /* 상품 총 갯수 */ 17 | public int goodsGetTotal(Criteria cri); 18 | 19 | /* 작가 id 리스트 요청 */ 20 | public String[] getAuthorIdList(String keyword); 21 | 22 | /* 국내 카테고리 리스트 */ 23 | public List getCateCode1(); 24 | 25 | /* 외국 카테고리 리스트 */ 26 | public List getCateCode2(); 27 | 28 | /* 검색 대상 카테고리 리스트 */ 29 | public String[] getCateList(Criteria cri); 30 | 31 | /* 카테고리 정보(+검색대상 갯수) */ 32 | public CateFilterDTO getCateInfo(Criteria cri); 33 | 34 | /* 상품 정보 */ 35 | public BookVO getGoodsInfo(int bookId); 36 | 37 | /* 상품 id 이름 */ 38 | public BookVO getBookIdName(int bookId); 39 | 40 | /* 평줌순 상품 정보 */ 41 | public List likeSelect(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/CartMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.CartDTO; 6 | 7 | public interface CartMapper { 8 | 9 | /* 카트 추가 */ 10 | public int addCart(CartDTO cart) throws Exception; 11 | 12 | /* 카트 삭제 */ 13 | public int deleteCart(int cartId); 14 | 15 | /* 카트 수량 수정 */ 16 | public int modifyCount(CartDTO cart); 17 | 18 | /* 카트 목록 */ 19 | public List getCart(String memberId); 20 | 21 | /* 카트 확인 */ 22 | public CartDTO checkCart(CartDTO cart); 23 | 24 | /* 카트 제거(주문) */ 25 | public int deleteOrderCart(CartDTO dto); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/MemberMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import com.vam.model.MemberVO; 4 | 5 | public interface MemberMapper { 6 | 7 | /* 회원가입 */ 8 | public void memberJoin(MemberVO member); 9 | 10 | /* 아이디 중복 검사 */ 11 | public int idCheck(String memberId); 12 | 13 | /* 로그인 */ 14 | public MemberVO memberLogin(MemberVO member); 15 | 16 | /* 주문자 주소 정보 */ 17 | public MemberVO getMemberInfo(String memberId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.BookVO; 6 | import com.vam.model.MemberVO; 7 | import com.vam.model.OrderDTO; 8 | import com.vam.model.OrderItemDTO; 9 | import com.vam.model.OrderPageItemDTO; 10 | 11 | public interface OrderMapper { 12 | 13 | /* 주문 상품 정보(주문 페이지) */ 14 | public OrderPageItemDTO getGoodsInfo(int bookId); 15 | 16 | /* 주문 상품 정보(주문 처리) */ 17 | public OrderItemDTO getOrderInfo(int bookId); 18 | 19 | /* 주문 테이블 등록 */ 20 | public int enrollOrder(OrderDTO ord); 21 | 22 | /* 주문 아이템 테이블 등록 */ 23 | public int enrollOrderItem(OrderItemDTO orid); 24 | 25 | /* 주문 금액 차감 */ 26 | public int deductMoney(MemberVO member); 27 | 28 | /* 주문 재고 차감 */ 29 | public int deductStock(BookVO book); 30 | 31 | /* 주문 취소 */ 32 | public int orderCancle(String orderId); 33 | 34 | /* 주문 상품 정보(주문취소) */ 35 | public List getOrderItemInfo(String orderId); 36 | 37 | /* 주문 정보(주문취소) */ 38 | public OrderDTO getOrder(String orderId); 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/mapper/ReplyMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.Criteria; 6 | import com.vam.model.ReplyDTO; 7 | import com.vam.model.UpdateReplyDTO; 8 | 9 | public interface ReplyMapper { 10 | 11 | /* 댓글 등록 */ 12 | public int enrollReply(ReplyDTO dto); 13 | 14 | /* 댓글 존재 체크 */ 15 | public Integer checkReply(ReplyDTO dto); 16 | 17 | /* 댓글 페이징 */ 18 | public List getReplyList(Criteria cri); 19 | 20 | /* 댓글 총 갯수(페이징) */ 21 | public int getReplyTotal(int bookId); 22 | 23 | /* 댓글 수정 */ 24 | public int updateReply(ReplyDTO dto); 25 | 26 | /* 댓글 한개 정보(수정페이지) */ 27 | public ReplyDTO getUpdateReply(int replyId); 28 | 29 | /* 댓글 삭제 */ 30 | public int deleteReply(int replyId); 31 | 32 | /* 평점 평균 구하기 */ 33 | public Double getRatingAverage(int bookId); 34 | 35 | /* 평점 평균 반영하기 */ 36 | public int updateRating(UpdateReplyDTO dto); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/AttachImageVO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class AttachImageVO { 4 | 5 | /* 경로 */ 6 | private String uploadPath; 7 | 8 | /* uuid */ 9 | private String uuid; 10 | 11 | /* 파일 이름 */ 12 | private String fileName; 13 | 14 | /* 상품 id */ 15 | private int bookId; 16 | 17 | public String getUploadPath() { 18 | return uploadPath; 19 | } 20 | 21 | public void setUploadPath(String uploadPath) { 22 | this.uploadPath = uploadPath; 23 | } 24 | 25 | public String getUuid() { 26 | return uuid; 27 | } 28 | 29 | public void setUuid(String uuid) { 30 | this.uuid = uuid; 31 | } 32 | 33 | public String getFileName() { 34 | return fileName; 35 | } 36 | 37 | public void setFileName(String fileName) { 38 | this.fileName = fileName; 39 | } 40 | 41 | public int getBookId() { 42 | return bookId; 43 | } 44 | 45 | public void setBookId(int bookId) { 46 | this.bookId = bookId; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "AttachImageVO [uploadPath=" + uploadPath + ", uuid=" + uuid + ", fileName=" + fileName + ", bookId=" 52 | + bookId + "]"; 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/AuthorVO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.Date; 4 | 5 | public class AuthorVO { 6 | 7 | /* 작가 아이디 */ 8 | private int authorId; 9 | 10 | /* 작가 이름 */ 11 | private String authorName; 12 | 13 | /* 국가 id */ 14 | private String nationId; 15 | 16 | /* 작가 국가 */ 17 | private String nationName; 18 | 19 | /* 작가 소개 */ 20 | private String authorIntro; 21 | 22 | /*등록 날짜*/ 23 | private Date regDate; 24 | 25 | /* 수정 날짜 */ 26 | private Date updateDate; 27 | 28 | public int getAuthorId() { 29 | return authorId; 30 | } 31 | 32 | public void setAuthorId(int authorId) { 33 | this.authorId = authorId; 34 | } 35 | 36 | public String getAuthorName() { 37 | return authorName; 38 | } 39 | 40 | public void setAuthorName(String authorName) { 41 | this.authorName = authorName; 42 | } 43 | 44 | public String getNationId() { 45 | return nationId; 46 | } 47 | 48 | public void setNationId(String nationId) { 49 | this.nationId = nationId; 50 | if(nationId.equals("01")) { 51 | this.nationName = "국내"; 52 | } else { 53 | this.nationName = "국외"; 54 | } 55 | } 56 | 57 | public String getNationName() { 58 | return nationName; 59 | } 60 | 61 | public void setNationName(String nationName) { 62 | this.nationName = nationName; 63 | } 64 | 65 | public String getAuthorIntro() { 66 | return authorIntro; 67 | } 68 | 69 | public void setAuthorIntro(String authorIntro) { 70 | this.authorIntro = authorIntro; 71 | } 72 | 73 | public Date getRegDate() { 74 | return regDate; 75 | } 76 | 77 | public void setRegDate(Date regDate) { 78 | this.regDate = regDate; 79 | } 80 | 81 | public Date getUpdateDate() { 82 | return updateDate; 83 | } 84 | 85 | public void setUpdateDate(Date updateDate) { 86 | this.updateDate = updateDate; 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | return "AuthorVO [authorId=" + authorId + ", authorName=" + authorName + ", nationId=" + nationId 92 | + ", nationName=" + nationName + ", authorIntro=" + authorIntro + ", regDate=" + regDate 93 | + ", updateDate=" + updateDate + "]"; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/CateFilterDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class CateFilterDTO { 4 | 5 | /* 카테고리 이름 */ 6 | private String cateName; 7 | 8 | /* 카테고리 넘버 */ 9 | private String cateCode;; 10 | 11 | /* 카테고리 상품 수 */ 12 | private int cateCount; 13 | 14 | /* 국내,국외 분류 */ 15 | private String cateGroup; 16 | 17 | public String getCateName() { 18 | return cateName; 19 | } 20 | 21 | public void setCateName(String cateName) { 22 | this.cateName = cateName; 23 | } 24 | 25 | public String getCateCode() { 26 | return cateCode; 27 | } 28 | 29 | public void setCateCode(String cateCode) { 30 | this.cateCode = cateCode; 31 | this.cateGroup = cateCode.split("")[0]; 32 | } 33 | 34 | public int getCateCount() { 35 | return cateCount; 36 | } 37 | 38 | public void setCateCount(int cateCount) { 39 | this.cateCount = cateCount; 40 | } 41 | 42 | public String getCateGroup() { 43 | return cateGroup; 44 | } 45 | 46 | public void setCateGroup(String cateGroup) { 47 | this.cateGroup = cateGroup; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "CateFilterDTO [cateName=" + cateName + ", cateCode=" + cateCode + ", cateCount=" + cateCount 53 | + ", cateGroup=" + cateGroup + "]"; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/CateVO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class CateVO { 4 | 5 | /* 카테고리 등급 */ 6 | private int tier; 7 | 8 | /* 카테고리 이름 */ 9 | private String cateName; 10 | 11 | /* 카테고리 넘버 */ 12 | private String cateCode; 13 | 14 | /* 상위 카테고리 */ 15 | private String cateParent; 16 | 17 | public int getTier() { 18 | return tier; 19 | } 20 | 21 | public void setTier(int tier) { 22 | this.tier = tier; 23 | } 24 | 25 | public String getCateName() { 26 | return cateName; 27 | } 28 | 29 | public void setCateName(String cateName) { 30 | this.cateName = cateName; 31 | } 32 | 33 | public String getCateCode() { 34 | return cateCode; 35 | } 36 | 37 | public void setCateCode(String cateCode) { 38 | this.cateCode = cateCode; 39 | } 40 | 41 | public String getCateParent() { 42 | return cateParent; 43 | } 44 | 45 | public void setCateParent(String cateParent) { 46 | this.cateParent = cateParent; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "CateVO [tier=" + tier + ", cateName=" + cateName + ", cateCode=" + cateCode + ", cateParent=" 52 | + cateParent + "]"; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/Criteria.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.Arrays; 4 | 5 | public class Criteria { 6 | 7 | /* 현재 페이지 번호 */ 8 | private int pageNum; 9 | 10 | /* 페이지 표시 개수 */ 11 | private int amount; 12 | 13 | /* 검색 타입 */ 14 | private String type; 15 | 16 | /* 검색 키워드 */ 17 | private String keyword; 18 | 19 | /* 작가 리스트 */ 20 | private String[] authorArr; 21 | 22 | /* 카테고리 코드 */ 23 | private String cateCode; 24 | 25 | /* 상품 번호(댓글 기능에서 사용) */ 26 | private int bookId; 27 | 28 | /* Criteria 생성자 */ 29 | public Criteria(int pageNum, int amount) { 30 | this.pageNum = pageNum; 31 | this.amount = amount; 32 | } 33 | 34 | /* Criteria 기본 생성자 */ 35 | public Criteria(){ 36 | this(1,10); 37 | } 38 | 39 | /* 검색 타입 데이터 배열 변환 */ 40 | public String[] getTypeArr() { 41 | return type == null? new String[] {}:type.split(""); 42 | } 43 | 44 | public int getPageNum() { 45 | return pageNum; 46 | } 47 | 48 | public void setPageNum(int pageNum) { 49 | this.pageNum = pageNum; 50 | } 51 | 52 | public int getAmount() { 53 | return amount; 54 | } 55 | 56 | public void setAmount(int amount) { 57 | this.amount = amount; 58 | } 59 | 60 | public String getType() { 61 | return type; 62 | } 63 | 64 | public void setType(String type) { 65 | this.type = type; 66 | } 67 | 68 | public String getKeyword() { 69 | return keyword; 70 | } 71 | 72 | public void setKeyword(String keyword) { 73 | this.keyword = keyword; 74 | } 75 | 76 | public String[] getAuthorArr() { 77 | return authorArr; 78 | } 79 | 80 | public void setAuthorArr(String[] authorArr) { 81 | this.authorArr = authorArr; 82 | } 83 | 84 | public String getCateCode() { 85 | return cateCode; 86 | } 87 | 88 | public void setCateCode(String cateCode) { 89 | this.cateCode = cateCode; 90 | } 91 | 92 | public int getBookId() { 93 | return bookId; 94 | } 95 | 96 | public void setBookId(int bookId) { 97 | this.bookId = bookId; 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | return "Criteria [pageNum=" + pageNum + ", amount=" + amount + ", type=" + type + ", keyword=" + keyword 103 | + ", authorArr=" + Arrays.toString(authorArr) + ", cateCode=" + cateCode + ", bookId=" + bookId + "]"; 104 | } 105 | 106 | 107 | 108 | 109 | 110 | } 111 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/OrderCancelDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class OrderCancelDTO { 4 | 5 | private String memberId; 6 | 7 | private String orderId; 8 | 9 | private String keyword; 10 | 11 | private int amount; 12 | 13 | private int pageNum; 14 | 15 | public String getMemberId() { 16 | return memberId; 17 | } 18 | 19 | public void setMemberId(String memberId) { 20 | this.memberId = memberId; 21 | } 22 | 23 | public String getOrderId() { 24 | return orderId; 25 | } 26 | 27 | public void setOrderId(String orderId) { 28 | this.orderId = orderId; 29 | } 30 | 31 | public String getKeyword() { 32 | return keyword; 33 | } 34 | 35 | public void setKeyword(String keyword) { 36 | this.keyword = keyword; 37 | } 38 | 39 | public int getAmount() { 40 | return amount; 41 | } 42 | 43 | public void setAmount(int amount) { 44 | this.amount = amount; 45 | } 46 | 47 | public int getPageNum() { 48 | return pageNum; 49 | } 50 | 51 | public void setPageNum(int pageNum) { 52 | this.pageNum = pageNum; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "OrderCancelDTO [memberId=" + memberId + ", orderId=" + orderId + ", keyword=" + keyword + ", amount=" 58 | + amount + ", pageNum=" + pageNum + "]"; 59 | } 60 | 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/OrderPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.List; 4 | 5 | public class OrderPageDTO { 6 | 7 | private List orders; 8 | 9 | public List getOrders() { 10 | return orders; 11 | } 12 | 13 | public void setOrders(List orders) { 14 | this.orders = orders; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "OrderPageDTO [orders=" + orders + "]"; 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/PageDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class PageDTO { 4 | 5 | /* 페이지 시작 번호 */ 6 | private int pageStart; 7 | 8 | /* 페이지 끝 번호 */ 9 | private int pageEnd; 10 | 11 | /* 이전, 다음 버튼 존재 유무 */ 12 | private boolean next, prev; 13 | 14 | /* 행 전체 개수 */ 15 | private int total; 16 | 17 | /* 현재페이지 번호(pageNum), 행 표시 수(amount), 검색 키워드(keyword), 검색 종류(type) */ 18 | private Criteria cri; 19 | 20 | /* 생성자(클래스 호출 시 각 변수 값 초기화) */ 21 | public PageDTO(Criteria cri, int total) { 22 | 23 | /* cri, total 초기화 */ 24 | this.cri = cri; 25 | this.total = total; 26 | 27 | /* 페이지 끝 번호 */ 28 | this.pageEnd = (int)(Math.ceil(cri.getPageNum()/10.0))*10; 29 | 30 | /* 페이지 시작 번호 */ 31 | this.pageStart = this.pageEnd - 9; 32 | 33 | /* 전체 마지막 페이지 번호 */ 34 | int realEnd = (int)(Math.ceil(total*1.0/cri.getAmount())); 35 | 36 | /* 페이지 끝 번호 유효성 체크 */ 37 | if(realEnd < pageEnd) { 38 | this.pageEnd = realEnd; 39 | } 40 | 41 | /* 이전 버튼 값 초기화 */ 42 | this.prev = this.pageStart > 1; 43 | 44 | /* 다음 버튼 값 초기화 */ 45 | this.next = this.pageEnd < realEnd; 46 | 47 | } 48 | 49 | public int getPageStart() { 50 | return pageStart; 51 | } 52 | 53 | public void setPageStart(int pageStart) { 54 | this.pageStart = pageStart; 55 | } 56 | 57 | public int getPageEnd() { 58 | return pageEnd; 59 | } 60 | 61 | public void setPageEnd(int pageEnd) { 62 | this.pageEnd = pageEnd; 63 | } 64 | 65 | public boolean isNext() { 66 | return next; 67 | } 68 | 69 | public void setNext(boolean next) { 70 | this.next = next; 71 | } 72 | 73 | public boolean isPrev() { 74 | return prev; 75 | } 76 | 77 | public void setPrev(boolean prev) { 78 | this.prev = prev; 79 | } 80 | 81 | public int getTotal() { 82 | return total; 83 | } 84 | 85 | public void setTotal(int total) { 86 | this.total = total; 87 | } 88 | 89 | public Criteria getCri() { 90 | return cri; 91 | } 92 | 93 | public void setCri(Criteria cri) { 94 | this.cri = cri; 95 | } 96 | 97 | @Override 98 | public String toString() { 99 | return "PageDTO [pageStart=" + pageStart + ", pageEnd=" + pageEnd + ", next=" + next + ", prev=" + prev 100 | + ", total=" + total + ", cri=" + cri + "]"; 101 | } 102 | 103 | 104 | 105 | } 106 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/ReplyDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.Date; 4 | 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | 7 | public class ReplyDTO { 8 | 9 | private int replyId; 10 | 11 | private int bookId; 12 | 13 | private String memberId; 14 | 15 | @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone="Asia/Seoul") 16 | private Date regDate; 17 | 18 | private String content; 19 | 20 | private double rating; 21 | 22 | public int getReplyId() { 23 | return replyId; 24 | } 25 | 26 | public void setReplyId(int replyId) { 27 | this.replyId = replyId; 28 | } 29 | 30 | public int getBookId() { 31 | return bookId; 32 | } 33 | 34 | public void setBookId(int bookId) { 35 | this.bookId = bookId; 36 | } 37 | 38 | public String getMemberId() { 39 | return memberId; 40 | } 41 | 42 | public void setMemberId(String memberId) { 43 | this.memberId = memberId; 44 | } 45 | 46 | public Date getRegDate() { 47 | return regDate; 48 | } 49 | 50 | public void setRegDate(Date regDate) { 51 | this.regDate = regDate; 52 | } 53 | 54 | public String getContent() { 55 | return content; 56 | } 57 | 58 | public void setContent(String content) { 59 | this.content = content; 60 | } 61 | 62 | public double getRating() { 63 | return rating; 64 | } 65 | 66 | public void setRating(double rating) { 67 | this.rating = rating; 68 | } 69 | 70 | @Override 71 | public String toString() { 72 | return "ReplyDTO [replyId=" + replyId + ", bookId=" + bookId + ", memberId=" + memberId + ", regDate=" + regDate 73 | + ", content=" + content + ", rating=" + rating + "]"; 74 | } 75 | 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/ReplyPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.List; 4 | 5 | public class ReplyPageDTO { 6 | 7 | List list; 8 | 9 | PageDTO pageInfo; 10 | 11 | public List getList() { 12 | return list; 13 | } 14 | 15 | public void setList(List list) { 16 | this.list = list; 17 | } 18 | 19 | public PageDTO getPageInfo() { 20 | return pageInfo; 21 | } 22 | 23 | public void setPageInfo(PageDTO pageInfo) { 24 | this.pageInfo = pageInfo; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return "ReplyPageDTO [list=" + list + ", pageInfo=" + pageInfo + "]"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/SelectDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.List; 4 | 5 | public class SelectDTO { 6 | 7 | /* 상품 id */ 8 | private int bookId; 9 | 10 | /* 상품 이름 */ 11 | private String bookName; 12 | 13 | /* 카테고리 이름 */ 14 | private String cateName; 15 | 16 | private double ratingAvg; 17 | 18 | /* 상품 이미지 */ 19 | private List imageList; 20 | 21 | public int getBookId() { 22 | return bookId; 23 | } 24 | 25 | public void setBookId(int bookId) { 26 | this.bookId = bookId; 27 | } 28 | 29 | public String getBookName() { 30 | return bookName; 31 | } 32 | 33 | public void setBookName(String bookName) { 34 | this.bookName = bookName; 35 | } 36 | 37 | public String getCateName() { 38 | return cateName; 39 | } 40 | 41 | public void setCateName(String cateName) { 42 | this.cateName = cateName; 43 | } 44 | 45 | public double getRatingAvg() { 46 | return ratingAvg; 47 | } 48 | 49 | public void setRatingAvg(double ratingAvg) { 50 | this.ratingAvg = ratingAvg; 51 | } 52 | 53 | public List getImageList() { 54 | return imageList; 55 | } 56 | 57 | public void setImageList(List imageList) { 58 | this.imageList = imageList; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return "SelectDTO [bookId=" + bookId + ", bookName=" + bookName + ", cateName=" + cateName + ", ratingAvg=" 64 | + ratingAvg + ", imageList=" + imageList + "]"; 65 | } 66 | 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/model/UpdateReplyDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class UpdateReplyDTO { 4 | 5 | private int bookId; 6 | 7 | private double ratingAvg; 8 | 9 | public int getBookId() { 10 | return bookId; 11 | } 12 | 13 | public void setBookId(int bookId) { 14 | this.bookId = bookId; 15 | } 16 | 17 | public double getRatingAvg() { 18 | return ratingAvg; 19 | } 20 | 21 | public void setRatingAvg(double ratingAvg) { 22 | this.ratingAvg = ratingAvg; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "UpdateReplyDTO [bookId=" + bookId + ", ratingAvg=" + ratingAvg + "]"; 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/sample/Chef.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import lombok.Data; 6 | 7 | @Component 8 | @Data 9 | public class Chef { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/sample/Restaurant.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Component; 5 | 6 | import lombok.Data; 7 | import lombok.Setter; 8 | 9 | @Component 10 | @Data 11 | public class Restaurant { 12 | 13 | @Setter(onMethod_=@Autowired) 14 | private Chef chef; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | import com.vam.model.BookVO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.OrderDTO; 10 | 11 | public interface AdminService { 12 | 13 | /* 상품 등록 */ 14 | public void bookEnroll(BookVO book); 15 | 16 | /* 카테고리 리스트 */ 17 | public List cateList(); 18 | 19 | /* 상품 리스트 */ 20 | public List goodsGetList(Criteria cri); 21 | 22 | /* 상품 총 개수 */ 23 | public int goodsGetTotal(Criteria cri); 24 | 25 | /* 상품 조회 페이지 */ 26 | public BookVO goodsGetDetail(int bookId); 27 | 28 | /* 상품 수정 */ 29 | public int goodsModify(BookVO vo); 30 | 31 | /* 상품 정보 삭제 */ 32 | public int goodsDelete(int bookId); 33 | 34 | /* 지정 상품 이미지 정보 얻기 */ 35 | public List getAttachInfo(int bookId); 36 | 37 | /* 주문 상품 리스트 */ 38 | public List getOrderList(Criteria cri); 39 | 40 | /* 주문 총 갯수 */ 41 | public int getOrderTotal(Criteria cri); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/AttachService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | 7 | public interface AttachService { 8 | 9 | /* 이미지 데이터 반환 */ 10 | public List getAttachList(int bookId); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/AttachServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.vam.mapper.AttachMapper; 9 | import com.vam.model.AttachImageVO; 10 | 11 | import lombok.extern.log4j.Log4j; 12 | 13 | @Service 14 | @Log4j 15 | public class AttachServiceImpl implements AttachService{ 16 | 17 | @Autowired 18 | private AttachMapper attachMapper; 19 | 20 | 21 | /* 이미지 데이터 반환 */ 22 | @Override 23 | public List getAttachList(int bookId) { 24 | 25 | log.info("getAttachList........."); 26 | 27 | return attachMapper.getAttachList(bookId); 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AuthorVO; 6 | import com.vam.model.Criteria; 7 | 8 | public interface AuthorService { 9 | 10 | /* 작가 등록 */ 11 | public void authorEnroll(AuthorVO author) throws Exception; 12 | 13 | /* 작가 목록 */ 14 | public List authorGetList(Criteria cri) throws Exception; 15 | 16 | /* 작가 총 수 */ 17 | public int authorGetTotal(Criteria cri) throws Exception; 18 | 19 | /* 작가 상세 페이지 */ 20 | public AuthorVO authorGetDetail(int authorId) throws Exception; 21 | 22 | /* 작가 정보 수정 */ 23 | public int authorModify(AuthorVO author) throws Exception; 24 | 25 | /* 작가 정보 삭제 */ 26 | public int authorDelete(int authorId); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/AuthorServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.vam.mapper.AuthorMapper; 11 | import com.vam.model.AuthorVO; 12 | import com.vam.model.Criteria; 13 | 14 | @Service 15 | public class AuthorServiceImpl implements AuthorService { 16 | 17 | private static final Logger log = LoggerFactory.getLogger(AuthorServiceImpl.class); 18 | 19 | @Autowired 20 | AuthorMapper authorMapper; 21 | 22 | /* 작가 등록 */ 23 | @Override 24 | public void authorEnroll(AuthorVO author) throws Exception { 25 | 26 | authorMapper.authorEnroll(author); 27 | 28 | } 29 | 30 | /* 작가 목록 */ 31 | @Override 32 | public List authorGetList(Criteria cri) throws Exception { 33 | 34 | log.info("(service)authorGetList()......." + cri); 35 | 36 | return authorMapper.authorGetList(cri); 37 | } 38 | 39 | /* 작가 총 수 */ 40 | @Override 41 | public int authorGetTotal(Criteria cri) throws Exception { 42 | log.info("(service)authorGetTotal()......." + cri); 43 | return authorMapper.authorGetTotal(cri); 44 | } 45 | 46 | /* 작가 상세 페이지 */ 47 | @Override 48 | public AuthorVO authorGetDetail(int authorId) throws Exception { 49 | log.info("authorGetDetail........" + authorId); 50 | return authorMapper.authorGetDetail(authorId); 51 | } 52 | 53 | /* 작가 정보 수정 */ 54 | @Override 55 | public int authorModify(AuthorVO author) throws Exception { 56 | log.info("(service) authorModify........." + author); 57 | return authorMapper.authorModify(author); 58 | } 59 | 60 | /* 작가 정보 삭제 */ 61 | @Override 62 | public int authorDelete(int authorId) { 63 | 64 | log.info("authorDelete.........."); 65 | 66 | return authorMapper.authorDelete(authorId); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/BookService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.BookVO; 6 | import com.vam.model.CateFilterDTO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.SelectDTO; 10 | 11 | public interface BookService { 12 | 13 | /* 상품 검색 */ 14 | public List getGoodsList(Criteria cri); 15 | 16 | /* 상품 총 갯수 */ 17 | public int goodsGetTotal(Criteria cri); 18 | 19 | /* 국내 카테고리 리스트 */ 20 | public List getCateCode1(); 21 | 22 | /* 외국 카테고리 리스트 */ 23 | public List getCateCode2(); 24 | 25 | /* 검색결과 카테고리 필터 정보 */ 26 | public List getCateInfoList(Criteria cri); 27 | 28 | /* 상품 정보 */ 29 | public BookVO getGoodsInfo(int bookId); 30 | 31 | /* 상품 id 이름 */ 32 | public BookVO getBookIdName(int bookId); 33 | 34 | /* 평줌순 상품 정보 */ 35 | public List likeSelect(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/CartService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.CartDTO; 6 | 7 | public interface CartService { 8 | 9 | /* 장바구니 추가 */ 10 | public int addCart(CartDTO cart); 11 | 12 | /* 장바구니 정보 리스트 */ 13 | public List getCartList(String memberId); 14 | 15 | /* 카트 수량 수정 */ 16 | public int modifyCount(CartDTO cart); 17 | 18 | /* 카트 삭제 */ 19 | public int deleteCart(int cartId); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/CartServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.vam.mapper.AttachMapper; 9 | import com.vam.mapper.CartMapper; 10 | import com.vam.model.AttachImageVO; 11 | import com.vam.model.CartDTO; 12 | @Service 13 | public class CartServiceImpl implements CartService { 14 | 15 | @Autowired 16 | private CartMapper cartMapper; 17 | 18 | @Autowired 19 | private AttachMapper attachMapper; 20 | 21 | @Override 22 | public int addCart(CartDTO cart) { 23 | 24 | // 장바구니 데이터 체크 25 | CartDTO checkCart = cartMapper.checkCart(cart); 26 | 27 | if(checkCart != null) { 28 | return 2; 29 | } 30 | 31 | // 장바구니 등록 & 에러 시 0반환 32 | try { 33 | return cartMapper.addCart(cart); 34 | } catch (Exception e) { 35 | return 0; 36 | } 37 | 38 | } 39 | 40 | @Override 41 | public List getCartList(String memberId) { 42 | 43 | List cart = cartMapper.getCart(memberId); 44 | 45 | for(CartDTO dto : cart) { 46 | 47 | /* 종합 정보 초기화 */ 48 | dto.initSaleTotal(); 49 | 50 | /* 이미지 정보 얻기 */ 51 | int bookId = dto.getBookId(); 52 | 53 | List imageList = attachMapper.getAttachList(bookId); 54 | 55 | dto.setImageList(imageList); 56 | } 57 | 58 | return cart; 59 | 60 | } 61 | 62 | @Override 63 | public int modifyCount(CartDTO cart) { 64 | 65 | return cartMapper.modifyCount(cart); 66 | } 67 | 68 | @Override 69 | public int deleteCart(int cartId) { 70 | 71 | return cartMapper.deleteCart(cartId); 72 | } 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/MemberService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import com.vam.model.MemberVO; 4 | 5 | public interface MemberService { 6 | 7 | /* 회원가입 */ 8 | public void memberJoin(MemberVO member) throws Exception; 9 | 10 | /* 아이디 중복 검사 */ 11 | public int idCheck(String memberId) throws Exception; 12 | 13 | /* 로그인 */ 14 | public MemberVO memberLogin(MemberVO member) throws Exception; 15 | 16 | /* 주문자 정보 */ 17 | public MemberVO getMemberInfo(String memberId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/MemberServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.vam.mapper.MemberMapper; 7 | import com.vam.model.MemberVO; 8 | 9 | @Service 10 | public class MemberServiceImpl implements MemberService{ 11 | 12 | @Autowired 13 | MemberMapper membermapper; 14 | 15 | /* 회원가입 */ 16 | @Override 17 | public void memberJoin(MemberVO member) throws Exception { 18 | 19 | membermapper.memberJoin(member); 20 | 21 | } 22 | 23 | /* 아이디 중복 검사 */ 24 | @Override 25 | public int idCheck(String memberId) throws Exception { 26 | 27 | return membermapper.idCheck(memberId); 28 | } 29 | 30 | /* 로그인 */ 31 | @Override 32 | public MemberVO memberLogin(MemberVO member) throws Exception { 33 | 34 | return membermapper.memberLogin(member); 35 | } 36 | 37 | /* 주문자 정보 */ 38 | @Override 39 | public MemberVO getMemberInfo(String memberId) { 40 | 41 | return membermapper.getMemberInfo(memberId); 42 | 43 | } 44 | 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.OrderCancelDTO; 6 | import com.vam.model.OrderDTO; 7 | import com.vam.model.OrderPageItemDTO; 8 | 9 | public interface OrderService { 10 | 11 | /* 주문 정보 */ 12 | public List getGoodsInfo(List orders); 13 | 14 | /* 주문 */ 15 | public void order(OrderDTO orw); 16 | 17 | /* 주문 취소 */ 18 | public void orderCancle(OrderCancelDTO dto); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/ReplyService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import com.vam.model.Criteria; 4 | import com.vam.model.ReplyDTO; 5 | import com.vam.model.ReplyPageDTO; 6 | 7 | public interface ReplyService { 8 | 9 | /* 댓글 등록 */ 10 | public int enrollReply(ReplyDTO dto); 11 | 12 | /* 댓글 존재 체크 */ 13 | public String checkReply(ReplyDTO dto); 14 | 15 | /* 댓글 페이징 */ 16 | public ReplyPageDTO replyList(Criteria cri); 17 | 18 | /* 댓글 수정 */ 19 | public int updateReply(ReplyDTO dto); 20 | 21 | /* 댓글 한개 정보(수정페이지) */ 22 | public ReplyDTO getUpdateReply(int replyId); 23 | 24 | /* 댓글 삭제 */ 25 | public int deleteReply(ReplyDTO dto); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/service/ReplyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.vam.mapper.ReplyMapper; 7 | import com.vam.model.Criteria; 8 | import com.vam.model.PageDTO; 9 | import com.vam.model.ReplyDTO; 10 | import com.vam.model.ReplyPageDTO; 11 | import com.vam.model.UpdateReplyDTO; 12 | 13 | @Service 14 | public class ReplyServiceImpl implements ReplyService{ 15 | 16 | @Autowired 17 | private ReplyMapper replyMapper; 18 | 19 | /* 댓글등록 */ 20 | @Override 21 | public int enrollReply(ReplyDTO dto) { 22 | 23 | int result = replyMapper.enrollReply(dto); 24 | 25 | setRating(dto.getBookId()); 26 | 27 | return result; 28 | } 29 | 30 | 31 | /* 댓글 존재 체크 */ 32 | @Override 33 | public String checkReply(ReplyDTO dto) { 34 | 35 | Integer result = replyMapper.checkReply(dto); 36 | 37 | if(result == null) { 38 | return "0"; 39 | } else { 40 | return "1"; 41 | } 42 | 43 | } 44 | 45 | @Override 46 | public ReplyPageDTO replyList(Criteria cri) { 47 | ReplyPageDTO dto = new ReplyPageDTO(); 48 | 49 | dto.setList(replyMapper.getReplyList(cri)); 50 | dto.setPageInfo(new PageDTO(cri, replyMapper.getReplyTotal(cri.getBookId()))); 51 | 52 | return dto; 53 | } 54 | 55 | @Override 56 | public int updateReply(ReplyDTO dto) { 57 | 58 | int result = replyMapper.updateReply(dto); 59 | 60 | setRating(dto.getBookId()); 61 | 62 | return result; 63 | } 64 | 65 | @Override 66 | public ReplyDTO getUpdateReply(int replyId) { 67 | 68 | return replyMapper.getUpdateReply(replyId); 69 | } 70 | 71 | @Override 72 | public int deleteReply(ReplyDTO dto) { 73 | 74 | int result = replyMapper.deleteReply(dto.getReplyId()); 75 | 76 | setRating(dto.getBookId()); 77 | 78 | return result; 79 | } 80 | 81 | public void setRating(int bookId) { 82 | 83 | Double ratingAvg = replyMapper.getRatingAverage(bookId); 84 | 85 | if(ratingAvg == null) { 86 | ratingAvg = 0.0; 87 | } 88 | 89 | ratingAvg = (double) (Math.round(ratingAvg*10)); 90 | ratingAvg = ratingAvg / 10; 91 | 92 | UpdateReplyDTO urd = new UpdateReplyDTO(); 93 | urd.setBookId(bookId); 94 | urd.setRatingAvg(ratingAvg); 95 | 96 | replyMapper.updateRating(urd); 97 | 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/task/AttachFileCheckTask.java: -------------------------------------------------------------------------------- 1 | package com.vam.task; 2 | 3 | import java.io.File; 4 | import java.nio.file.Path; 5 | import java.nio.file.Paths; 6 | import java.text.SimpleDateFormat; 7 | import java.util.ArrayList; 8 | import java.util.Arrays; 9 | import java.util.Calendar; 10 | import java.util.Date; 11 | import java.util.List; 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.scheduling.annotation.Scheduled; 15 | import org.springframework.stereotype.Component; 16 | 17 | import com.vam.mapper.AdminMapper; 18 | import com.vam.model.AttachImageVO; 19 | 20 | import lombok.extern.log4j.Log4j; 21 | 22 | @Component 23 | @Log4j 24 | public class AttachFileCheckTask { 25 | 26 | @Autowired 27 | private AdminMapper mapper; 28 | 29 | private String getFolderYesterDay() { 30 | 31 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 32 | 33 | Calendar cal = Calendar.getInstance(); 34 | 35 | cal.add(Calendar.DATE, -1); 36 | 37 | String str = sdf.format(cal.getTime()); 38 | 39 | return str.replace("-", File.separator); 40 | } 41 | 42 | @Scheduled(cron="0 * * * * *") 43 | public void checkFiles() throws Exception{ 44 | 45 | log.warn("File Check Task Run.........."); 46 | log.warn(new Date()); 47 | log.warn("========================================"); 48 | 49 | // DB에 저장된 파일 리스트 50 | List fileList = mapper.checkFileList(); 51 | 52 | 53 | // 비교 기준 파일 리스트(Path객체) 54 | List checkFilePath = new ArrayList(); 55 | //원본 이미지 56 | fileList.forEach(vo -> { 57 | Path path = Paths.get("C:\\upload", vo.getUploadPath(), vo.getUuid() + "_" + vo.getFileName()); 58 | checkFilePath.add(path); 59 | }); 60 | //썸네일 이미지 61 | fileList.forEach(vo -> { 62 | Path path = Paths.get("C:\\upload", vo.getUploadPath(), "s_" + vo.getUuid() + "_" + vo.getFileName()); 63 | checkFilePath.add(path); 64 | }); 65 | 66 | 67 | // 디렉토리 파일 리스트 68 | File targetDir = Paths.get("C:\\upload", getFolderYesterDay()).toFile(); 69 | File[] targetFile = targetDir.listFiles(); 70 | 71 | 72 | // 삭제 대상 파일 리스트(분류) 73 | List removeFileList = new ArrayList(Arrays.asList(targetFile)); 74 | for(File file : targetFile){ 75 | checkFilePath.forEach(checkFile ->{ 76 | if(file.toPath().equals(checkFile)) 77 | removeFileList.remove(file); 78 | }); 79 | } 80 | 81 | 82 | // 삭제 대상 파일 제거 83 | log.warn("file Delete : "); 84 | for(File file : removeFileList) { 85 | log.warn(file); 86 | file.delete(); 87 | } 88 | 89 | log.warn("========================================"); 90 | 91 | } 92 | 93 | 94 | } 95 | -------------------------------------------------------------------------------- /VamPa/src/main/java/com/vam/task/testBatch.java: -------------------------------------------------------------------------------- 1 | package com.vam.task; 2 | 3 | import org.springframework.scheduling.annotation.Scheduled; 4 | import org.springframework.stereotype.Component; 5 | 6 | import lombok.extern.log4j.Log4j; 7 | 8 | 9 | @Log4j 10 | public class testBatch { 11 | 12 | 13 | @Scheduled(cron = "0 * * * * *") 14 | public void testMethod() throws Exception{ 15 | 16 | log.warn("배치 실행 테스트......."); 17 | log.warn("==================================="); 18 | 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/com/vam/mapper/AttachMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/com/vam/mapper/AuthorMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_author(authorName, nationId, authorIntro) values(#{authorName}, #{nationId}, #{authorIntro} ) 11 | 12 | 13 | 14 | 15 | 16 | 37 | 38 | 39 | 50 | 51 | 52 | 57 | 58 | 59 | 60 | 61 | update vam_author set authorName=#{authorName}, nationId=#{nationId}, authorIntro=#{authorIntro}, updatedate=sysdate where authorId = #{authorId} 62 | 63 | 64 | 65 | 66 | 67 | 68 | delete from vam_author where authorId = #{authorId} 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/com/vam/mapper/CartMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_cart(memberId, bookId, bookCount) 11 | values(#{memberId}, #{bookId}, #{bookCount}) 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | delete from vam_cart where cartId = #{cartId} 20 | 21 | 22 | 23 | 24 | 25 | 26 | update vam_cart set bookCount=#{bookCount} where cartId = #{cartId} 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | delete from vam_cart where memberId = #{memberId} and bookId = #{bookId} 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/com/vam/mapper/MemberMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into book_member values(#{memberId}, #{memberPw}, #{memberName}, #{memberMail}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, 0, sysdate, 100000, 5000 ) 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 29 | 30 | 31 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/com/vam/mapper/OrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | insert into vam_order(orderId, addressee, memberId, memberAddr1, memberAddr2, memberAddr3, orderState, deliveryCost, usePoint) 26 | values(#{orderId},#{addressee}, #{memberId}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, '배송준비', #{deliveryCost}, #{usePoint}) 27 | 28 | 29 | 30 | 31 | 32 | 33 | insert into vam_orderItem(orderId, bookId, bookCount, bookPrice, bookDiscount, savePoint) 34 | values(#{orderId}, #{bookId}, #{bookCount}, #{bookPrice}, #{bookDiscount}, #{savePoint}) 35 | 36 | 37 | 38 | 39 | 40 | 41 | update book_member set money = #{money}, point = #{point} where memberid = #{memberId} 42 | 43 | 44 | 45 | 46 | 47 | 48 | update vam_book set bookStock = #{bookStock} where bookId = #{bookId} 49 | 50 | 51 | 52 | 53 | 54 | 55 | update vam_order set orderState = '주문취소' where orderId = #{orderId} 56 | 57 | 58 | 59 | 60 | 66 | 67 | 68 | 74 | 75 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/com/vam/mapper/ReplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating}) 11 | 12 | 13 | 14 | 20 | 21 | 22 | 35 | 36 | 43 | 44 | 45 | 46 | 47 | update vam_reply set content = #{content}, rating = #{rating} 48 | where replyId = #{replyId} 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | DELETE FROM vam_reply 64 | WHERE replyId = #{replyId} 65 | 66 | 67 | 68 | 75 | 76 | 77 | 78 | update vam_book 79 | set ratingAvg = #{ratingAvg} 80 | where bookId = #{bookId} 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa/src/main/resources/log4jdbc.log4j2.properties: -------------------------------------------------------------------------------- 1 | log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/spring/appServlet/security-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/views/admin/main.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 14 | 15 | 16 | 17 | <%@include file="../includes/admin/header.jsp" %> 18 | 19 |
20 |
관리자 페이지 입니다.
21 |
22 | 23 | <%@include file="../includes/admin/footer.jsp" %> 24 | 25 | 26 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | 4 | 5 | Home 6 | 7 | 8 |

9 | Hello world! 10 |

11 | 12 |

The time on the server is ${serverTime}.

13 | 14 | 15 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/views/includes/admin/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 |
4 | 5 | 6 | 7 | 23 | 24 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/views/includes/admin/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 |
5 |
6 | 7 |
8 | 13 |
14 | 15 |
16 | 관리자 페이지 17 | 18 |
19 | 20 |
21 | 22 |
23 | 43 |
-------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/views/member/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 |
21 |
22 | Book Mall 23 |
24 | 44 |
45 | 46 |
47 | 48 |
49 | 50 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | contextConfigLocation 9 | /WEB-INF/spring/root-context.xml 10 | 11 | 12 | 13 | 14 | org.springframework.web.context.ContextLoaderListener 15 | 16 | 17 | 18 | 19 | appServlet 20 | org.springframework.web.servlet.DispatcherServlet 21 | 22 | contextConfigLocation 23 | 24 | /WEB-INF/spring/appServlet/servlet-context.xml 25 | /WEB-INF/spring/appServlet/security-context.xml 26 | 27 | 28 | 1 29 | 30 | 31 | 32 | C:\\upload\\temp 33 | 20971520 34 | 41943040 35 | 20971520 36 | 37 | 38 | 39 | 40 | 41 | appServlet 42 | / 43 | 44 | 45 | 46 | encodingFilter 47 | 48 | org.springframework.web.filter.CharacterEncodingFilter 49 | 50 | 51 | encoding 52 | UTF-8 53 | 54 | 55 | forceEncoding 56 | true 57 | 58 | 59 | 60 | encodingFilter 61 | /* 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/css/admin/authorPop.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /* 전체 wrap */ 4 | .wrapper{ 5 | width:100%; 6 | height:535px; 7 | } 8 | .subject_name_warp{ 9 | font-size: 33px; 10 | font-weight: bolder; 11 | padding-left: 15px; 12 | background-color: #6AAFE6; 13 | height: 13%; 14 | line-height: 70px; 15 | color: white; 16 | } 17 | .content_wrap{ 18 | height:87%; 19 | } 20 | 21 | 22 | 23 | 24 | /* 작가 목록 영역 */ 25 | .author_table_wrap{ 26 | padding: 20px 35px 27 | } 28 | .table_exist{ 29 | height:251px; 30 | } 31 | .author_table{ 32 | width: 100%; 33 | border: 1px solid #d3d8e1; 34 | text-align: center; 35 | border-collapse: collapse; 36 | } 37 | .author_table td{ 38 | padding: 10px 5px; 39 | border : 1px solid #e9ebf0; 40 | } 41 | .author_table thead{ 42 | background-color: #f8f9fd; 43 | font-weight: 600; 44 | } 45 | .author_table a{ 46 | color:#1088ed; 47 | font-weight: 500; 48 | } 49 | .th_column_1{ 50 | width:120px; 51 | } 52 | .th_column_3{ 53 | width:110px; 54 | } 55 | 56 | 57 | .table_empty{ 58 | text-align: center; 59 | margin: 101px 0 130px 0; 60 | font-size: 25px; 61 | } 62 | 63 | /* 검색 영역 */ 64 | .search_wrap{ 65 | margin-top:25px; 66 | } 67 | .search_input{ 68 | position: relative; 69 | text-align:center; 70 | } 71 | .search_input input[name='keyword']{ 72 | padding: 4px 10px; 73 | font-size: 15px; 74 | height: 20px; 75 | line-height: 20px; 76 | } 77 | .search_btn{ 78 | height: 32px; 79 | width: 80px; 80 | font-weight: 600; 81 | font-size: 18px; 82 | line-height: 20px; 83 | position: absolute; 84 | margin-left: 15px; 85 | background-color: #c3daf7; 86 | } 87 | 88 | /* 페이지 버튼 인터페이스 */ 89 | .pageMaker_wrap{ 90 | margin-top: 20px; 91 | margin-bottom: 40px; 92 | } 93 | .pageMaker{ 94 | list-style: none; 95 | display: inline-block; 96 | } 97 | .pageMaker_btn { 98 | text-align: center; 99 | float: left; 100 | width: 30px; 101 | height: 30px; 102 | line-height: 30px; 103 | margin-left: 8px; 104 | font-size: 15px; 105 | } 106 | .active{ 107 | border : 2px solid black; 108 | font-weight:400; 109 | } 110 | .next, .prev { 111 | border: 1px solid #ccc; 112 | padding: 0 10px; 113 | } 114 | .next a, .prev a { 115 | color: #ccc; 116 | } -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/css/member/login.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | *{ 3 | margin: 0; 4 | padding:0; 5 | } 6 | 7 | /* 화면 전체 렙 */ 8 | .wrapper{ 9 | width: 100%; 10 | } 11 | 12 | /* content 랩 */ 13 | .wrap{ 14 | width : 800px; 15 | margin: auto; 16 | } 17 | 18 | /* 페이지 로고 */ 19 | .logo_wrap{ 20 | text-align: center; 21 | margin: 150px 0; 22 | } 23 | .logo_wrap>span{ 24 | font-size : 50px; 25 | font-weight: 900; 26 | } 27 | 28 | 29 | /* 로그인 area */ 30 | .id_input_box{ 31 | border: 1px solid black; 32 | height:31px; 33 | padding: 10px 14px; 34 | display: block; 35 | width : 80%; 36 | margin : auto; 37 | } 38 | .id_input{ 39 | width:100%; 40 | height:100%; 41 | border:none; 42 | font-size:28px; 43 | } 44 | 45 | 46 | .pw_wrap{ 47 | margin-top: 40px; 48 | } 49 | .pw_input_box{ 50 | border: 1px solid black; 51 | height:31px; 52 | padding: 10px 14px; 53 | display: block; 54 | width : 80%; 55 | margin : auto; 56 | } 57 | .pw_iput{ 58 | width:100%; 59 | height:100%; 60 | border:none; 61 | font-size:28px; 62 | } 63 | 64 | 65 | .login_button_wrap{ 66 | margin-top: 40px; 67 | text-align: center; 68 | } 69 | .login_button{ 70 | width: 84%; 71 | height: 80px; 72 | background-color: #6AAFE6; 73 | font-size: 40px; 74 | font-weight: 900; 75 | color: white; 76 | margin : auto; 77 | } 78 | 79 | /* 로그인 실패시 경고글 */ 80 | .login_warn{ 81 | margin-top: 30px; 82 | text-align: center; 83 | color : red; 84 | } 85 | 86 | /* float 속성 해제 */ 87 | .clearfix{ 88 | clear: both; 89 | } 90 | -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/img/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa/src/main/webapp/resources/img/Logo.png -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/img/bnA_w01_a8daff.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa/src/main/webapp/resources/img/bnA_w01_a8daff.jpg -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/img/bnD_w01_c3c5f7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa/src/main/webapp/resources/img/bnD_w01_c3c5f7.jpg -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/img/bnK_w01_c3c5f7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa/src/main/webapp/resources/img/bnK_w01_c3c5f7.jpg -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/img/goodsNoImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa/src/main/webapp/resources/img/goodsNoImage.png -------------------------------------------------------------------------------- /VamPa/src/main/webapp/resources/img/mLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa/src/main/webapp/resources/img/mLogo.png -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/mapper/AttachMapperTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 11 | public class AttachMapperTests { 12 | 13 | @Autowired 14 | private AttachMapper attachMapper; 15 | 16 | /*이미지 정보 반환*/ 17 | @Test 18 | public void getAttachListTests() { 19 | 20 | int bookId = 3125; 21 | 22 | System.out.println("이미지 정보 : " + attachMapper.getAttachList(bookId)); 23 | 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/mapper/MemberMapperTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import com.vam.model.MemberVO; 10 | 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 13 | public class MemberMapperTests { 14 | 15 | @Autowired 16 | private MemberMapper membermapper; //MemberMapper.java 인터페이스 의존성 주입 17 | 18 | 19 | /* 회원가입 쿼리 테스트 메서드 */ 20 | /* 21 | @Test 22 | public void memberJoin() throws Exception{ 23 | MemberVO member = new MemberVO(); 24 | 25 | member.setMemberId("test"); //회원 id 26 | member.setMemberPw("test"); //회원 비밀번호 27 | member.setMemberName("test"); //회원 이름 28 | member.setMemberMail("test"); //회원 메일 29 | member.setMemberAddr1("test"); //회원 우편번호 30 | member.setMemberAddr2("test"); //회원 주소 31 | member.setMemberAddr3("test"); //회원 상세주소 32 | 33 | membermapper.memberJoin(member); //쿼리 메서드 실행 34 | 35 | } 36 | */ 37 | 38 | 39 | /*아이디 중복검사*/ 40 | /* 41 | @Test 42 | public void memberIdChk() throws Exception{ 43 | String id = "admin"; // 존재하는 아이디 44 | String id2 = "test123"; // 존재하지 않는 아이디 45 | membermapper.idCheck(id); 46 | membermapper.idCheck(id2); 47 | } 48 | */ 49 | 50 | 51 | /* 로그인 쿼리 mapper 메서드 테스트 */ 52 | @Test 53 | public void memberLogin() throws Exception{ 54 | 55 | MemberVO member = new MemberVO(); // MemberVO 변수 선언 및 초기화 56 | 57 | /* 올바른 아이디 비번 입력경우 */ 58 | //member.setMemberId("test1"); 59 | //member.setMemberPw("test1"); 60 | 61 | /* 올바른 않은 아이디 비번 입력경우 */ 62 | member.setMemberId("test1123"); 63 | member.setMemberPw("test1321321"); 64 | 65 | membermapper.memberLogin(member); 66 | System.out.println("결과 값 : " + membermapper.memberLogin(member)); 67 | 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/mapper/ReplyMapperTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import com.vam.model.ReplyDTO; 10 | 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 13 | public class ReplyMapperTests { 14 | 15 | @Autowired 16 | private ReplyMapper mapper; 17 | 18 | 19 | @Test 20 | public void replyEnrollTest() { 21 | 22 | String id = "admin"; 23 | int bookId = 95; 24 | double rating = 3.5; 25 | String content = "댓글 테스트"; 26 | 27 | ReplyDTO dto = new ReplyDTO(); 28 | dto.setBookId(bookId); 29 | dto.setMemberId(id); 30 | dto.setRating(rating); 31 | dto.setContent(content); 32 | 33 | mapper.enrollReply(dto); 34 | 35 | 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/persistence/JDBCTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.persistence; 2 | 3 | import static org.junit.Assert.fail; 4 | 5 | import java.sql.Connection; 6 | import java.sql.DriverManager; 7 | 8 | import org.junit.Test; 9 | 10 | public class JDBCTests { 11 | 12 | static { 13 | try { 14 | Class.forName("oracle.jdbc.driver.OracleDriver"); 15 | }catch(Exception e) { 16 | e.printStackTrace(); 17 | } 18 | } 19 | 20 | @Test 21 | public void testConnection() { 22 | 23 | try(Connection con = 24 | DriverManager.getConnection( 25 | "jdbc:oracle:thin:@localhost:1521:orcl", 26 | "vam", 27 | "1234")){ 28 | System.out.println(con); 29 | }catch(Exception e) { 30 | fail(e.getMessage()); 31 | } 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/sample/DataSourceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import java.sql.Connection; 4 | 5 | import javax.sql.DataSource; 6 | 7 | import org.apache.ibatis.session.SqlSession; 8 | import org.apache.ibatis.session.SqlSessionFactory; 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.test.context.ContextConfiguration; 13 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 17 | public class DataSourceTests { 18 | 19 | @Autowired 20 | private DataSource dataSource; 21 | 22 | @Autowired 23 | private SqlSessionFactory sqlSessionFactory; 24 | 25 | @Test 26 | public void testConnection() { 27 | try( 28 | Connection con = dataSource.getConnection(); 29 | SqlSession session = sqlSessionFactory.openSession(); 30 | ){ 31 | 32 | System.out.println("con=" + con); 33 | System.out.println("session=" + session); 34 | 35 | }catch(Exception e) { 36 | e.printStackTrace(); 37 | } 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/sample/SampleTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import static org.junit.Assert.assertNotNull; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.test.context.ContextConfiguration; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | 11 | import lombok.extern.log4j.Log4j; 12 | 13 | @RunWith(SpringJUnit4ClassRunner.class) 14 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 15 | @Log4j 16 | public class SampleTests { 17 | 18 | @Autowired 19 | private Restaurant restaurant; 20 | 21 | @Test 22 | public void textExit() { 23 | 24 | assertNotNull(restaurant); 25 | 26 | log.info(restaurant);; 27 | log.info("-------------------------------"); 28 | log.info(restaurant.getChef()); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/service/AdminServiceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.vam.model.AttachImageVO; 13 | import com.vam.model.BookVO; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 17 | public class AdminServiceTests { 18 | 19 | @Autowired 20 | private AdminService service; 21 | 22 | 23 | /* 상품 등록 & 상품 이미지 등록 테스트 */ 24 | @Test 25 | public void bookEnrollTEsts() { 26 | 27 | BookVO book = new BookVO(); 28 | // 상품 정보 29 | book.setBookName("service 테스트"); 30 | book.setAuthorId(27); 31 | book.setPubleYear("2021-03-18"); 32 | book.setPublisher("출판사"); 33 | book.setCateCode("202001"); 34 | book.setBookPrice(20000); 35 | book.setBookStock(300); 36 | book.setBookDiscount(0.23); 37 | book.setBookIntro("책 소개 "); 38 | book.setBookContents("책 목차 "); 39 | 40 | // 이미지 정보 41 | List imageList = new ArrayList(); 42 | 43 | AttachImageVO image1 = new AttachImageVO(); 44 | AttachImageVO image2 = new AttachImageVO(); 45 | 46 | image1.setFileName("test Image 1"); 47 | image1.setUploadPath("test image 1"); 48 | image1.setUuid("test11112"); 49 | 50 | image2.setFileName("test Image 2"); 51 | image2.setUploadPath("test image 2"); 52 | image2.setUuid("test22222"); 53 | 54 | imageList.add(image1); 55 | imageList.add(image2); 56 | 57 | 58 | book.setImageList(imageList); 59 | 60 | // bookEnroll() 메서드 호출 61 | service.bookEnroll(book); 62 | 63 | System.out.println("등록된 VO : " + book); 64 | 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/service/AuthorServiceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import com.vam.model.AuthorVO; 10 | 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 13 | public class AuthorServiceTests { 14 | 15 | /*AuthoreService 의존성 주입*/ 16 | @Autowired 17 | private AuthorService service; 18 | 19 | /* 작가 등록 테스트 */ 20 | /* 21 | @Test 22 | public void authorEnrollTest() throws Exception { 23 | 24 | AuthorVO author = new AuthorVO(); 25 | 26 | author.setNationId("01"); 27 | author.setAuthorName("테스트"); 28 | author.setAuthorIntro("테스트 소개"); 29 | 30 | service.authorEnroll(author); 31 | 32 | } 33 | */ 34 | 35 | /* 작가 목록 구현 */ 36 | /* 37 | @Test 38 | public void authorGetListTest() throws Exception{ 39 | 40 | Criteria cri = new Criteria(3, 10); 41 | 42 | List list = service.authorGetList(cri); 43 | 44 | for(int i = 0; i < list.size(); i++) { 45 | System.out.println("list" + i + "......." + list.get(i)); 46 | } 47 | 48 | } 49 | */ 50 | 51 | /*작가 상세 페이지*/ 52 | /* 53 | @Test 54 | public void authorGetDetailTest() throws Exception{ 55 | 56 | int authorId = 20; 57 | 58 | Log.info("author......" + service.authorGetDetail(authorId)); 59 | 60 | } 61 | */ 62 | 63 | /* 작가 정보 수정 */ 64 | @Test 65 | public void authorModifyTest() throws Exception { 66 | 67 | AuthorVO author = new AuthorVO(); 68 | 69 | author.setAuthorId(1); 70 | System.out.println("(service)수정 전...................." + service.authorGetDetail(author.getAuthorId())); 71 | 72 | author.setAuthorName("(service)수정"); 73 | author.setNationId("01"); 74 | author.setAuthorIntro("(service)소개 수정 하였습니다."); 75 | 76 | service.authorModify(author); 77 | System.out.println("(service)수정 후...................." + service.authorGetDetail(author.getAuthorId())); 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /VamPa/src/test/java/com/vam/service/CartServiceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import com.vam.model.CartDTO; 10 | 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 13 | public class CartServiceTests { 14 | 15 | @Autowired 16 | private CartService service; 17 | 18 | //등록 테스트 19 | @Test 20 | public void addCartTest() { 21 | //given 22 | String memberId = "admin"; 23 | int bookId = 22; 24 | int count = 5; 25 | 26 | CartDTO dto = new CartDTO(); 27 | dto.setMemberId(memberId); 28 | dto.setBookId(bookId); 29 | dto.setBookCount(count); 30 | 31 | //when 32 | int result = service.addCart(dto); 33 | 34 | //then 35 | System.out.println("** result : " + result); 36 | 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /VamPa/src/test/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa/target/classes/com/vam/mapper/AttachMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /VamPa/target/classes/com/vam/mapper/AuthorMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_author(authorName, nationId, authorIntro) values(#{authorName}, #{nationId}, #{authorIntro} ) 11 | 12 | 13 | 14 | 15 | 16 | 37 | 38 | 39 | 50 | 51 | 52 | 57 | 58 | 59 | 60 | 61 | update vam_author set authorName=#{authorName}, nationId=#{nationId}, authorIntro=#{authorIntro}, updatedate=sysdate where authorId = #{authorId} 62 | 63 | 64 | 65 | 66 | 67 | 68 | delete from vam_author where authorId = #{authorId} 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /VamPa/target/classes/com/vam/mapper/CartMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_cart(memberId, bookId, bookCount) 11 | values(#{memberId}, #{bookId}, #{bookCount}) 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | delete from vam_cart where cartId = #{cartId} 20 | 21 | 22 | 23 | 24 | 25 | 26 | update vam_cart set bookCount=#{bookCount} where cartId = #{cartId} 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | delete from vam_cart where memberId = #{memberId} and bookId = #{bookId} 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /VamPa/target/classes/com/vam/mapper/MemberMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into book_member values(#{memberId}, #{memberPw}, #{memberName}, #{memberMail}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, 0, sysdate, 100000, 5000 ) 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 29 | 30 | 31 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /VamPa/target/classes/com/vam/mapper/OrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | insert into vam_order(orderId, addressee, memberId, memberAddr1, memberAddr2, memberAddr3, orderState, deliveryCost, usePoint) 26 | values(#{orderId},#{addressee}, #{memberId}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, '배송준비', #{deliveryCost}, #{usePoint}) 27 | 28 | 29 | 30 | 31 | 32 | 33 | insert into vam_orderItem(orderId, bookId, bookCount, bookPrice, bookDiscount, savePoint) 34 | values(#{orderId}, #{bookId}, #{bookCount}, #{bookPrice}, #{bookDiscount}, #{savePoint}) 35 | 36 | 37 | 38 | 39 | 40 | 41 | update book_member set money = #{money}, point = #{point} where memberid = #{memberId} 42 | 43 | 44 | 45 | 46 | 47 | 48 | update vam_book set bookStock = #{bookStock} where bookId = #{bookId} 49 | 50 | 51 | 52 | 53 | 54 | 55 | update vam_order set orderState = '주문취소' where orderId = #{orderId} 56 | 57 | 58 | 59 | 60 | 66 | 67 | 68 | 74 | 75 | -------------------------------------------------------------------------------- /VamPa/target/classes/com/vam/mapper/ReplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating}) 11 | 12 | 13 | 14 | 20 | 21 | 22 | 35 | 36 | 43 | 44 | 45 | 46 | 47 | update vam_reply set content = #{content}, rating = #{rating} 48 | where replyId = #{replyId} 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | DELETE FROM vam_reply 64 | WHERE replyId = #{replyId} 65 | 66 | 67 | 68 | 75 | 76 | 77 | 78 | update vam_book 79 | set ratingAvg = #{ratingAvg} 80 | where bookId = #{bookId} 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /VamPa/target/classes/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa/target/classes/log4jdbc.log4j2.properties: -------------------------------------------------------------------------------- 1 | log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator -------------------------------------------------------------------------------- /VamPa/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: sjinj 3 | Build-Jdk: 15.0.1 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Tue Feb 22 01:43:37 KST 2022 3 | m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project2\\VamPa 4 | m2e.projectName=VamPa 5 | groupId=com.vam 6 | artifactId=controller 7 | version=1.0.0-BUILD-SNAPSHOT 8 | -------------------------------------------------------------------------------- /VamPa/target/test-classes/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa_MySQL/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/java,windows,eclipse 3 | # Edit at https://www.gitignore.io/?templates=java,windows,eclipse 4 | 5 | ### Eclipse ### 6 | .metadata 7 | bin/ 8 | tmp/ 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | local.properties 14 | .settings/ 15 | .loadpath 16 | .recommenders 17 | 18 | # External tool builders 19 | .externalToolBuilders/ 20 | 21 | # Locally stored "Eclipse launch configurations" 22 | *.launch 23 | 24 | # PyDev specific (Python IDE for Eclipse) 25 | *.pydevproject 26 | 27 | # CDT-specific (C/C++ Development Tooling) 28 | .cproject 29 | 30 | # CDT- autotools 31 | .autotools 32 | 33 | # Java annotation processor (APT) 34 | .factorypath 35 | 36 | # PDT-specific (PHP Development Tools) 37 | .buildpath 38 | 39 | # sbteclipse plugin 40 | .target 41 | 42 | # Tern plugin 43 | .tern-project 44 | 45 | # TeXlipse plugin 46 | .texlipse 47 | 48 | # STS (Spring Tool Suite) 49 | .springBeans 50 | 51 | # Code Recommenders 52 | .recommenders/ 53 | 54 | # Annotation Processing 55 | .apt_generated/ 56 | 57 | # Scala IDE specific (Scala & Java development for Eclipse) 58 | .cache-main 59 | .scala_dependencies 60 | .worksheet 61 | 62 | ### Eclipse Patch ### 63 | # Eclipse Core 64 | .project 65 | 66 | # JDT-specific (Eclipse Java Development Tools) 67 | .classpath 68 | 69 | # Annotation Processing 70 | .apt_generated 71 | 72 | .sts4-cache/ 73 | 74 | ### Java ### 75 | # Compiled class file 76 | *.class 77 | 78 | # Log file 79 | *.log 80 | 81 | # BlueJ files 82 | *.ctxt 83 | 84 | # Mobile Tools for Java (J2ME) 85 | .mtj.tmp/ 86 | 87 | # Package Files # 88 | *.jar 89 | *.war 90 | *.nar 91 | *.ear 92 | *.zip 93 | *.tar.gz 94 | *.rar 95 | 96 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 97 | hs_err_pid* 98 | 99 | ### Windows ### 100 | # Windows thumbnail cache files 101 | Thumbs.db 102 | Thumbs.db:encryptable 103 | ehthumbs.db 104 | ehthumbs_vista.db 105 | 106 | # Dump file 107 | *.stackdump 108 | 109 | # Folder config file 110 | [Dd]esktop.ini 111 | 112 | # Recycle Bin used on file shares 113 | $RECYCLE.BIN/ 114 | 115 | # Windows Installer files 116 | *.cab 117 | *.msi 118 | *.msix 119 | *.msm 120 | *.msp 121 | 122 | # Windows shortcuts 123 | *.lnk 124 | 125 | # End of https://www.gitignore.io/api/java,windows,eclipse -------------------------------------------------------------------------------- /VamPa_MySQL/Blog_Project/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: sjinj 3 | Build-Jdk: 1.8.0_221 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /VamPa_MySQL/Blog_Project/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Fri Aug 07 23:18:18 KST 2020 3 | version=1.0.0-BUILD-SNAPSHOT 4 | groupId=com.vam 5 | m2e.projectName=VamPa_MySQL 6 | m2e.projectLocation=C\:\\Users\\sjinj\\git\\blog_project\\VamPa_MySQL 7 | artifactId=controller 8 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/controller/CartController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import com.vam.model.CartDTO; 15 | import com.vam.model.MemberVO; 16 | import com.vam.service.CartService; 17 | 18 | @Controller 19 | public class CartController { 20 | 21 | @Autowired 22 | private CartService cartService; 23 | 24 | 25 | /* 장바구니 추가 */ 26 | /** 27 | * 0: 등록 실패 28 | * 1: 등록 성공 29 | * 2: 등록된 데이터 존재 30 | * 5: 로그인 필요 31 | * 32 | */ 33 | @PostMapping("/cart/add") 34 | @ResponseBody 35 | public String addCartPOST(CartDTO cart, HttpServletRequest request) { 36 | // 로그인 체크 37 | HttpSession session = request.getSession(); 38 | MemberVO mvo = (MemberVO)session.getAttribute("member"); 39 | if(mvo == null) { 40 | return "5"; 41 | } 42 | 43 | // 카트 등록 44 | 45 | int result = cartService.addCart(cart); 46 | 47 | return result + ""; 48 | } 49 | 50 | /* 장바구니 페이지 이동 */ 51 | @GetMapping("/cart/{memberId}") 52 | public String cartPageGET(@PathVariable("memberId") String memberId, Model model) { 53 | 54 | model.addAttribute("cartInfo", cartService.getCartList(memberId)); 55 | 56 | return "/cart"; 57 | } 58 | 59 | /* 장바구니 수량 수정 */ 60 | @PostMapping("/cart/update") 61 | public String updateCartPOST(CartDTO cart) { 62 | 63 | cartService.modifyCount(cart); 64 | 65 | return "redirect:/cart/" + cart.getMemberId(); 66 | 67 | } 68 | 69 | /* 장바구니 수량 수정 */ 70 | @PostMapping("/cart/delete") 71 | public String deleteCartPOST(CartDTO cart) { 72 | 73 | cartService.deleteCart(cart.getCartId()); 74 | 75 | return "redirect:/cart/" + cart.getMemberId(); 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import java.text.DateFormat; 4 | import java.util.Date; 5 | import java.util.Locale; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | 14 | /** 15 | * Handles requests for the application home page. 16 | */ 17 | @Controller 18 | public class HomeController { 19 | 20 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 21 | 22 | /** 23 | * Simply selects the home view to render by returning its name. 24 | */ 25 | @RequestMapping(value = "/", method = RequestMethod.GET) 26 | public String home(Locale locale, Model model) { 27 | logger.info("Welcome home! The client locale is {}.", locale); 28 | 29 | Date date = new Date(); 30 | DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); 31 | 32 | String formattedDate = dateFormat.format(date); 33 | 34 | model.addAttribute("serverTime", formattedDate ); 35 | 36 | return "home"; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | 13 | import com.vam.model.MemberVO; 14 | import com.vam.model.OrderDTO; 15 | import com.vam.model.OrderPageDTO; 16 | import com.vam.service.MemberService; 17 | import com.vam.service.OrderService; 18 | 19 | @Controller 20 | public class OrderController { 21 | 22 | @Autowired 23 | private OrderService orderService; 24 | 25 | @Autowired 26 | private MemberService memberService; 27 | 28 | @GetMapping("/order/{memberId}") 29 | public String orderPgaeGET(@PathVariable("memberId") String memberId, OrderPageDTO opd, Model model) { 30 | 31 | model.addAttribute("orderList", orderService.getGoodsInfo(opd.getOrders())); 32 | model.addAttribute("memberInfo", memberService.getMemberInfo(memberId)); 33 | 34 | 35 | return "/order"; 36 | } 37 | 38 | @PostMapping("/order") 39 | public String orderPagePost(OrderDTO od, HttpServletRequest request) { 40 | 41 | System.out.println(od); 42 | 43 | orderService.order(od); 44 | 45 | MemberVO member = new MemberVO(); 46 | member.setMemberId(od.getMemberId()); 47 | 48 | HttpSession session = request.getSession(); 49 | 50 | try { 51 | MemberVO memberLogin = memberService.memberLogin(member); 52 | memberLogin.setMemberPw(""); 53 | session.setAttribute("member", memberLogin); 54 | 55 | } catch (Exception e) { 56 | 57 | e.printStackTrace(); 58 | } 59 | 60 | return "redirect:/main"; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/controller/ReplyController.java: -------------------------------------------------------------------------------- 1 | package com.vam.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.MediaType; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PostMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import com.vam.model.Criteria; 11 | import com.vam.model.ReplyDTO; 12 | import com.vam.model.ReplyPageDTO; 13 | import com.vam.service.ReplyService; 14 | 15 | @RestController 16 | @RequestMapping("/reply") 17 | public class ReplyController { 18 | 19 | @Autowired 20 | private ReplyService replyService; 21 | 22 | /* 댓글 등록 */ 23 | @PostMapping("/enroll") 24 | public void enrollReplyPOST(ReplyDTO dto) { 25 | replyService.enrollReply(dto); 26 | } 27 | 28 | /* 댓글 체크 */ 29 | /* memberId, bookId 파라미터 */ 30 | /* 존재 : 1 / 존재x : 0 */ 31 | @PostMapping("/check") 32 | public String replyCheckPOST(ReplyDTO dto) { 33 | return replyService.checkReply(dto); 34 | } 35 | 36 | /* 댓글 페이징 */ 37 | @GetMapping(value="/list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 38 | public ReplyPageDTO replyListPOST(Criteria cri) { 39 | return replyService.replyList(cri); 40 | } 41 | 42 | /* 댓글 수정 */ 43 | @PostMapping("/update") 44 | public void replyModifyPOST(ReplyDTO dto) { 45 | replyService.updateReply(dto); 46 | } 47 | 48 | /* 댓글 삭제 */ 49 | @PostMapping("/delete") 50 | public void replyDeletePOST(ReplyDTO dto) { 51 | replyService.deleteReply(dto); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/interceptor/AdminInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vam.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | 9 | import com.vam.model.MemberVO; 10 | 11 | public class AdminInterceptor implements HandlerInterceptor { 12 | 13 | @Override 14 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 15 | throws Exception { 16 | 17 | HttpSession session = request.getSession(); 18 | 19 | MemberVO lvo = (MemberVO)session.getAttribute("member"); 20 | 21 | if(lvo == null || lvo.getAdminCk() == 0) { // 관리자 계정 아닌 경우 22 | 23 | response.sendRedirect("/main"); // 메인페이지로 리다이렉트 24 | 25 | return false; 26 | 27 | } 28 | 29 | return true; // 관리자 계정 로그인 경우(lvo != null && lvo.getAdminCk() == 1) 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/interceptor/CartInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vam.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | 9 | import com.vam.model.MemberVO; 10 | 11 | public class CartInterceptor implements HandlerInterceptor { 12 | 13 | @Override 14 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 15 | throws Exception { 16 | 17 | HttpSession session = request.getSession(); 18 | 19 | MemberVO mvo = (MemberVO)session.getAttribute("member"); 20 | 21 | if(mvo == null) { 22 | response.sendRedirect("/main"); 23 | return false; 24 | } else { 25 | return true; 26 | } 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.vam.interceptor; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import javax.servlet.http.HttpSession; 6 | 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | 9 | public class LoginInterceptor implements HandlerInterceptor { 10 | 11 | @Override 12 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) 13 | throws Exception { 14 | 15 | System.out.println("LoginInterceptor preHandle 작동"); 16 | 17 | HttpSession session = request.getSession(); 18 | 19 | session.invalidate(); 20 | 21 | return true; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | import com.vam.model.BookVO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.OrderDTO; 10 | 11 | public interface AdminMapper { 12 | 13 | /* 상품 등록 */ 14 | public void bookEnroll(BookVO book); 15 | 16 | /* 카테고리 리스트 */ 17 | public List cateList(); 18 | 19 | /* 상품 리스트 */ 20 | public List goodsGetList(Criteria cri); 21 | 22 | /* 상품 총 개수 */ 23 | public int goodsGetTotal(Criteria cri); 24 | 25 | /* 상품 조회 페이지 */ 26 | public BookVO goodsGetDetail(int bookId); 27 | 28 | /* 상품 수정 */ 29 | public int goodsModify(BookVO vo); 30 | 31 | /* 상품 정보 삭제 */ 32 | public int goodsDelete(int bookId); 33 | 34 | /* 이미지 등록 */ 35 | public void imageEnroll(AttachImageVO vo); 36 | 37 | /* 지정 상품 이미지 전체 삭제 */ 38 | public void deleteImageAll(int bookId); 39 | 40 | /* 어제자 날짜 이미지 리스트 */ 41 | public List checkFileList(); 42 | 43 | /* 지정 상품 이미지 정보 얻기 */ 44 | public List getAttachInfo(int bookId); 45 | 46 | /* 주문 상품 리스트 */ 47 | public List getOrderList(Criteria cri); 48 | 49 | /* 주문 총 갯수 */ 50 | public int getOrderTotal(Criteria cri); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/AttachMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | 7 | public interface AttachMapper { 8 | 9 | /* 이미지 데이터 반환 */ 10 | public List getAttachList(int bookId); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/AuthorMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AuthorVO; 6 | import com.vam.model.Criteria; 7 | 8 | public interface AuthorMapper { 9 | 10 | /* 작가 등록 */ 11 | public void authorEnroll(AuthorVO author); 12 | 13 | /* 작가 목록 */ 14 | public List authorGetList(Criteria cri); 15 | 16 | /* 작가 총 수 */ 17 | public int authorGetTotal(Criteria cri); 18 | 19 | /* 작가 상세 */ 20 | public AuthorVO authorGetDetail(int authorId); 21 | 22 | /* 작가 정보 수정 */ 23 | public int authorModify(AuthorVO author); 24 | 25 | /* 작가 정보 삭제 */ 26 | public int authorDelete(int authorId); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/BookMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.BookVO; 6 | import com.vam.model.CateFilterDTO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.SelectDTO; 10 | 11 | public interface BookMapper { 12 | 13 | /* 상품 검색 */ 14 | public List getGoodsList(Criteria cri); 15 | 16 | /* 상품 총 갯수 */ 17 | public int goodsGetTotal(Criteria cri); 18 | 19 | /* 작가 id 리스트 요청 */ 20 | public String[] getAuthorIdList(String keyword); 21 | 22 | /* 국내 카테고리 리스트 */ 23 | public List getCateCode1(); 24 | 25 | /* 외국 카테고리 리스트 */ 26 | public List getCateCode2(); 27 | 28 | /* 검색 대상 카테고리 리스트 */ 29 | public String[] getCateList(Criteria cri); 30 | 31 | /* 카테고리 정보(+검색대상 갯수) */ 32 | public CateFilterDTO getCateInfo(Criteria cri); 33 | 34 | /* 상품 정보 */ 35 | public BookVO getGoodsInfo(int bookId); 36 | 37 | /* 상품 id 이름 */ 38 | public BookVO getBookIdName(int bookId); 39 | 40 | /* 평줌순 상품 정보 */ 41 | public List likeSelect(); 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/CartMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.CartDTO; 6 | 7 | public interface CartMapper { 8 | 9 | /* 카트 추가 */ 10 | public int addCart(CartDTO cart) throws Exception; 11 | 12 | /* 카트 삭제 */ 13 | public int deleteCart(int cartId); 14 | 15 | /* 카트 수량 수정 */ 16 | public int modifyCount(CartDTO cart); 17 | 18 | /* 카트 목록 */ 19 | public List getCart(String memberId); 20 | 21 | /* 카트 확인 */ 22 | public CartDTO checkCart(CartDTO cart); 23 | 24 | /* 카트 제거(주문) */ 25 | public int deleteOrderCart(CartDTO dto); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/MemberMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import com.vam.model.MemberVO; 4 | 5 | public interface MemberMapper { 6 | 7 | /* 회원가입 */ 8 | public void memberJoin(MemberVO member); 9 | 10 | /* 아이디 중복 검사 */ 11 | public int idCheck(String memberId); 12 | 13 | /* 로그인 */ 14 | public MemberVO memberLogin(MemberVO member); 15 | 16 | /* 주문자 주소 정보 */ 17 | public MemberVO getMemberInfo(String memberId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.BookVO; 6 | import com.vam.model.MemberVO; 7 | import com.vam.model.OrderDTO; 8 | import com.vam.model.OrderItemDTO; 9 | import com.vam.model.OrderPageItemDTO; 10 | 11 | public interface OrderMapper { 12 | 13 | /* 주문 상품 정보 */ 14 | public OrderPageItemDTO getGoodsInfo(int bookId); 15 | 16 | /* 주문 상품 정보(주문 처리) */ 17 | public OrderItemDTO getOrderInfo(int bookId); 18 | 19 | /* 주문 테이블 등록 */ 20 | public int enrollOrder(OrderDTO ord); 21 | 22 | /* 주문 아이템 테이블 등록 */ 23 | public int enrollOrderItem(OrderItemDTO orid); 24 | 25 | /* 주문 금액 차감 */ 26 | public int deductMoney(MemberVO member); 27 | 28 | /* 주문 재고 차감 */ 29 | public int deductStock(BookVO book); 30 | 31 | /* 주문 취소 */ 32 | public int orderCancle(String orderId); 33 | 34 | /* 주문 상품 정보(주문취소) */ 35 | public List getOrderItemInfo(String orderId); 36 | 37 | /* 주문 정보(주문취소) */ 38 | public OrderDTO getOrder(String orderId); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/mapper/ReplyMapper.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.Criteria; 6 | import com.vam.model.ReplyDTO; 7 | import com.vam.model.UpdateReplyDTO; 8 | 9 | public interface ReplyMapper { 10 | 11 | /* 댓글 등록 */ 12 | public int enrollReply(ReplyDTO dto); 13 | 14 | /* 댓글 존재 체크 */ 15 | public Integer checkReply(ReplyDTO dto); 16 | 17 | /* 댓글 페이징 */ 18 | public List getReplyList(Criteria cri); 19 | 20 | /* 댓글 총 갯수(페이징) */ 21 | public int getReplyTotal(int bookId); 22 | 23 | /* 댓글 수정 */ 24 | public int updateReply(ReplyDTO dto); 25 | 26 | /* 댓글 한개 정보(수정페이지) */ 27 | public ReplyDTO getUpdateReply(int replyId); 28 | 29 | /* 댓글 삭제 */ 30 | public int deleteReply(int replyId); 31 | 32 | /* 평점 평균 구하기 */ 33 | public Double getRatingAverage(int bookId); 34 | 35 | /* 평점 평균 반영하기 */ 36 | public int updateRating(UpdateReplyDTO dto); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/AttachImageVO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class AttachImageVO { 4 | 5 | /* 경로 */ 6 | private String uploadPath; 7 | 8 | /* uuid */ 9 | private String uuid; 10 | 11 | /* 파일 이름 */ 12 | private String fileName; 13 | 14 | /* 상품 id */ 15 | private int bookId; 16 | 17 | public String getUploadPath() { 18 | return uploadPath; 19 | } 20 | 21 | public void setUploadPath(String uploadPath) { 22 | this.uploadPath = uploadPath; 23 | } 24 | 25 | public String getUuid() { 26 | return uuid; 27 | } 28 | 29 | public void setUuid(String uuid) { 30 | this.uuid = uuid; 31 | } 32 | 33 | public String getFileName() { 34 | return fileName; 35 | } 36 | 37 | public void setFileName(String fileName) { 38 | this.fileName = fileName; 39 | } 40 | 41 | public int getBookId() { 42 | return bookId; 43 | } 44 | 45 | public void setBookId(int bookId) { 46 | this.bookId = bookId; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "AttachImageVO [uploadPath=" + uploadPath + ", uuid=" + uuid + ", fileName=" + fileName + ", bookId=" 52 | + bookId + "]"; 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/AuthorVO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.Date; 4 | 5 | public class AuthorVO { 6 | 7 | /* 작가 아이디 */ 8 | private int authorId; 9 | 10 | /* 작가 이름 */ 11 | private String authorName; 12 | 13 | /* 국가 id */ 14 | private String nationId; 15 | 16 | /* 작가 국가 */ 17 | private String nationName; 18 | 19 | /* 작가 소개 */ 20 | private String authorIntro; 21 | 22 | /*등록 날짜*/ 23 | private Date regDate; 24 | 25 | /* 수정 날짜 */ 26 | private Date updateDate; 27 | 28 | public int getAuthorId() { 29 | return authorId; 30 | } 31 | 32 | public void setAuthorId(int authorId) { 33 | this.authorId = authorId; 34 | } 35 | 36 | public String getAuthorName() { 37 | return authorName; 38 | } 39 | 40 | public void setAuthorName(String authorName) { 41 | this.authorName = authorName; 42 | } 43 | 44 | public String getNationId() { 45 | return nationId; 46 | } 47 | 48 | public void setNationId(String nationId) { 49 | this.nationId = nationId; 50 | if(nationId.equals("01")) { 51 | this.nationName = "국내"; 52 | } else { 53 | this.nationName = "국외"; 54 | } 55 | } 56 | 57 | public String getNationName() { 58 | return nationName; 59 | } 60 | 61 | public void setNationName(String nationName) { 62 | this.nationName = nationName; 63 | } 64 | 65 | public String getAuthorIntro() { 66 | return authorIntro; 67 | } 68 | 69 | public void setAuthorIntro(String authorIntro) { 70 | this.authorIntro = authorIntro; 71 | } 72 | 73 | public Date getRegDate() { 74 | return regDate; 75 | } 76 | 77 | public void setRegDate(Date regDate) { 78 | this.regDate = regDate; 79 | } 80 | 81 | public Date getUpdateDate() { 82 | return updateDate; 83 | } 84 | 85 | public void setUpdateDate(Date updateDate) { 86 | this.updateDate = updateDate; 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | return "AuthorVO [authorId=" + authorId + ", authorName=" + authorName + ", nationId=" + nationId 92 | + ", nationName=" + nationName + ", authorIntro=" + authorIntro + ", regDate=" + regDate 93 | + ", updateDate=" + updateDate + "]"; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/CateFilterDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class CateFilterDTO { 4 | 5 | /* 카테고리 이름 */ 6 | private String cateName; 7 | 8 | /* 카테고리 넘버 */ 9 | private String cateCode;; 10 | 11 | /* 카테고리 상품 수 */ 12 | private int cateCount; 13 | 14 | /* 국내,국외 분류 */ 15 | private String cateGroup; 16 | 17 | public String getCateName() { 18 | return cateName; 19 | } 20 | 21 | public void setCateName(String cateName) { 22 | this.cateName = cateName; 23 | } 24 | 25 | public String getCateCode() { 26 | return cateCode; 27 | } 28 | 29 | public void setCateCode(String cateCode) { 30 | this.cateCode = cateCode; 31 | this.cateGroup = cateCode.split("")[0]; 32 | } 33 | 34 | public int getCateCount() { 35 | return cateCount; 36 | } 37 | 38 | public void setCateCount(int cateCount) { 39 | this.cateCount = cateCount; 40 | } 41 | 42 | public String getCateGroup() { 43 | return cateGroup; 44 | } 45 | 46 | public void setCateGroup(String cateGroup) { 47 | this.cateGroup = cateGroup; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "CateFilterDTO [cateName=" + cateName + ", cateCode=" + cateCode + ", cateCount=" + cateCount 53 | + ", cateGroup=" + cateGroup + "]"; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/CateVO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class CateVO { 4 | 5 | /* 카테고리 등급 */ 6 | private int tier; 7 | 8 | /* 카테고리 이름 */ 9 | private String cateName; 10 | 11 | /* 카테고리 넘버 */ 12 | private String cateCode; 13 | 14 | /* 상위 카테고리 */ 15 | private String cateParent; 16 | 17 | public int getTier() { 18 | return tier; 19 | } 20 | 21 | public void setTier(int tier) { 22 | this.tier = tier; 23 | } 24 | 25 | public String getCateName() { 26 | return cateName; 27 | } 28 | 29 | public void setCateName(String cateName) { 30 | this.cateName = cateName; 31 | } 32 | 33 | public String getCateCode() { 34 | return cateCode; 35 | } 36 | 37 | public void setCateCode(String cateCode) { 38 | this.cateCode = cateCode; 39 | } 40 | 41 | public String getCateParent() { 42 | return cateParent; 43 | } 44 | 45 | public void setCateParent(String cateParent) { 46 | this.cateParent = cateParent; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "CateVO [tier=" + tier + ", cateName=" + cateName + ", cateCode=" + cateCode + ", cateParent=" 52 | + cateParent + "]"; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/OrderCancelDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class OrderCancelDTO { 4 | 5 | private String memberId; 6 | 7 | private String orderId; 8 | 9 | private String keyword; 10 | 11 | private int amount; 12 | 13 | private int pageNum; 14 | 15 | public String getMemberId() { 16 | return memberId; 17 | } 18 | 19 | public void setMemberId(String memberId) { 20 | this.memberId = memberId; 21 | } 22 | 23 | public String getOrderId() { 24 | return orderId; 25 | } 26 | 27 | public void setOrderId(String orderId) { 28 | this.orderId = orderId; 29 | } 30 | 31 | public String getKeyword() { 32 | return keyword; 33 | } 34 | 35 | public void setKeyword(String keyword) { 36 | this.keyword = keyword; 37 | } 38 | 39 | public int getAmount() { 40 | return amount; 41 | } 42 | 43 | public void setAmount(int amount) { 44 | this.amount = amount; 45 | } 46 | 47 | public int getPageNum() { 48 | return pageNum; 49 | } 50 | 51 | public void setPageNum(int pageNum) { 52 | this.pageNum = pageNum; 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "OrderCancelDTO [memberId=" + memberId + ", orderId=" + orderId + ", keyword=" + keyword + ", amount=" 58 | + amount + ", pageNum=" + pageNum + "]"; 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/OrderPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.List; 4 | 5 | public class OrderPageDTO { 6 | 7 | private List orders; 8 | 9 | public List getOrders() { 10 | return orders; 11 | } 12 | 13 | public void setOrders(List orders) { 14 | this.orders = orders; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "OrderPageDTO [orders=" + orders + "]"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/PageDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class PageDTO { 4 | 5 | /* 페이지 시작 번호 */ 6 | private int pageStart; 7 | 8 | /* 페이지 끝 번호 */ 9 | private int pageEnd; 10 | 11 | /* 이전, 다음 버튼 존재 유무 */ 12 | private boolean next, prev; 13 | 14 | /* 행 전체 개수 */ 15 | private int total; 16 | 17 | /* 현재페이지 번호(pageNum), 행 표시 수(amount), 검색 키워드(keyword), 검색 종류(type) */ 18 | private Criteria cri; 19 | 20 | /* 생성자(클래스 호출 시 각 변수 값 초기화) */ 21 | public PageDTO(Criteria cri, int total) { 22 | 23 | /* cri, total 초기화 */ 24 | this.cri = cri; 25 | this.total = total; 26 | 27 | /* 페이지 끝 번호 */ 28 | this.pageEnd = (int)(Math.ceil(cri.getPageNum()/10.0))*10; 29 | 30 | /* 페이지 시작 번호 */ 31 | this.pageStart = this.pageEnd - 9; 32 | 33 | /* 전체 마지막 페이지 번호 */ 34 | int realEnd = (int)(Math.ceil(total*1.0/cri.getAmount())); 35 | 36 | /* 페이지 끝 번호 유효성 체크 */ 37 | if(realEnd < pageEnd) { 38 | this.pageEnd = realEnd; 39 | } 40 | 41 | /* 이전 버튼 값 초기화 */ 42 | this.prev = this.pageStart > 1; 43 | 44 | /* 다음 버튼 값 초기화 */ 45 | this.next = this.pageEnd < realEnd; 46 | 47 | } 48 | 49 | public int getPageStart() { 50 | return pageStart; 51 | } 52 | 53 | public void setPageStart(int pageStart) { 54 | this.pageStart = pageStart; 55 | } 56 | 57 | public int getPageEnd() { 58 | return pageEnd; 59 | } 60 | 61 | public void setPageEnd(int pageEnd) { 62 | this.pageEnd = pageEnd; 63 | } 64 | 65 | public boolean isNext() { 66 | return next; 67 | } 68 | 69 | public void setNext(boolean next) { 70 | this.next = next; 71 | } 72 | 73 | public boolean isPrev() { 74 | return prev; 75 | } 76 | 77 | public void setPrev(boolean prev) { 78 | this.prev = prev; 79 | } 80 | 81 | public int getTotal() { 82 | return total; 83 | } 84 | 85 | public void setTotal(int total) { 86 | this.total = total; 87 | } 88 | 89 | public Criteria getCri() { 90 | return cri; 91 | } 92 | 93 | public void setCri(Criteria cri) { 94 | this.cri = cri; 95 | } 96 | 97 | @Override 98 | public String toString() { 99 | return "PageDTO [pageStart=" + pageStart + ", pageEnd=" + pageEnd + ", next=" + next + ", prev=" + prev 100 | + ", total=" + total + ", cri=" + cri + "]"; 101 | } 102 | 103 | 104 | } 105 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/ReplyDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.Date; 4 | 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | 7 | public class ReplyDTO { 8 | 9 | private int replyId; 10 | 11 | private int bookId; 12 | 13 | private String memberId; 14 | 15 | @JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd", timezone="Asia/Seoul") 16 | private Date regDate; 17 | 18 | private String content; 19 | 20 | private double rating; 21 | 22 | public int getReplyId() { 23 | return replyId; 24 | } 25 | 26 | public void setReplyId(int replyId) { 27 | this.replyId = replyId; 28 | } 29 | 30 | public int getBookId() { 31 | return bookId; 32 | } 33 | 34 | public void setBookId(int bookId) { 35 | this.bookId = bookId; 36 | } 37 | 38 | public String getMemberId() { 39 | return memberId; 40 | } 41 | 42 | public void setMemberId(String memberId) { 43 | this.memberId = memberId; 44 | } 45 | 46 | public Date getRegDate() { 47 | return regDate; 48 | } 49 | 50 | public void setRegDate(Date regDate) { 51 | this.regDate = regDate; 52 | } 53 | 54 | public String getContent() { 55 | return content; 56 | } 57 | 58 | public void setContent(String content) { 59 | this.content = content; 60 | } 61 | 62 | public double getRating() { 63 | return rating; 64 | } 65 | 66 | public void setRating(double rating) { 67 | this.rating = rating; 68 | } 69 | 70 | @Override 71 | public String toString() { 72 | return "ReplyDTO [replyId=" + replyId + ", bookId=" + bookId + ", memberId=" + memberId + ", regDate=" + regDate 73 | + ", content=" + content + ", rating=" + rating + "]"; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/ReplyPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.List; 4 | 5 | public class ReplyPageDTO { 6 | 7 | List list; 8 | 9 | PageDTO pageInfo; 10 | 11 | public List getList() { 12 | return list; 13 | } 14 | 15 | public void setList(List list) { 16 | this.list = list; 17 | } 18 | 19 | public PageDTO getPageInfo() { 20 | return pageInfo; 21 | } 22 | 23 | public void setPageInfo(PageDTO pageInfo) { 24 | this.pageInfo = pageInfo; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return "ReplyPageDTO [list=" + list + ", pageInfo=" + pageInfo + "]"; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/SelectDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | import java.util.List; 4 | 5 | public class SelectDTO { 6 | 7 | /* 상품 id */ 8 | private int bookId; 9 | 10 | /* 상품 이름 */ 11 | private String bookName; 12 | 13 | /* 카테고리 이름 */ 14 | private String cateName; 15 | 16 | private double ratingAvg; 17 | 18 | /* 상품 이미지 */ 19 | private List imageList; 20 | 21 | public int getBookId() { 22 | return bookId; 23 | } 24 | 25 | public void setBookId(int bookId) { 26 | this.bookId = bookId; 27 | } 28 | 29 | public String getBookName() { 30 | return bookName; 31 | } 32 | 33 | public void setBookName(String bookName) { 34 | this.bookName = bookName; 35 | } 36 | 37 | public String getCateName() { 38 | return cateName; 39 | } 40 | 41 | public void setCateName(String cateName) { 42 | this.cateName = cateName; 43 | } 44 | 45 | public double getRatingAvg() { 46 | return ratingAvg; 47 | } 48 | 49 | public void setRatingAvg(double ratingAvg) { 50 | this.ratingAvg = ratingAvg; 51 | } 52 | 53 | public List getImageList() { 54 | return imageList; 55 | } 56 | 57 | public void setImageList(List imageList) { 58 | this.imageList = imageList; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return "SelectDTO [bookId=" + bookId + ", bookName=" + bookName + ", cateName=" + cateName + ", ratingAvg=" 64 | + ratingAvg + ", imageList=" + imageList + "]"; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/model/UpdateReplyDTO.java: -------------------------------------------------------------------------------- 1 | package com.vam.model; 2 | 3 | public class UpdateReplyDTO { 4 | 5 | private int bookId; 6 | 7 | private double ratingAvg; 8 | 9 | public int getBookId() { 10 | return bookId; 11 | } 12 | 13 | public void setBookId(int bookId) { 14 | this.bookId = bookId; 15 | } 16 | 17 | public double getRatingAvg() { 18 | return ratingAvg; 19 | } 20 | 21 | public void setRatingAvg(double ratingAvg) { 22 | this.ratingAvg = ratingAvg; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "UpdateReplyDTO [bookId=" + bookId + ", ratingAvg=" + ratingAvg + "]"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/sample/Chef.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import lombok.Data; 6 | 7 | @Component 8 | @Data 9 | public class Chef { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/sample/Restaurant.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Component; 5 | 6 | import lombok.Data; 7 | import lombok.Setter; 8 | 9 | @Component 10 | @Data 11 | public class Restaurant { 12 | 13 | @Setter(onMethod_=@Autowired) 14 | private Chef chef; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | import com.vam.model.BookVO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.OrderDTO; 10 | 11 | public interface AdminService { 12 | 13 | /* 상품 등록 */ 14 | public void bookEnroll(BookVO book); 15 | 16 | /* 카테고리 리스트 */ 17 | public List cateList(); 18 | 19 | /* 상품 리스트 */ 20 | public List goodsGetList(Criteria cri); 21 | 22 | /* 상품 총 개수 */ 23 | public int goodsGetTotal(Criteria cri); 24 | 25 | /* 상품 조회 페이지 */ 26 | public BookVO goodsGetDetail(int bookId); 27 | 28 | /* 상품 수정 */ 29 | public int goodsModify(BookVO vo); 30 | 31 | /* 상품 정보 삭제 */ 32 | public int goodsDelete(int bookId); 33 | 34 | /* 지정 상품 이미지 정보 얻기 */ 35 | public List getAttachInfo(int bookId); 36 | 37 | /* 주문 상품 리스트 */ 38 | public List getOrderList(Criteria cri); 39 | 40 | /* 주문 총 갯수 */ 41 | public int getOrderTotal(Criteria cri); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/AttachService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AttachImageVO; 6 | 7 | public interface AttachService { 8 | 9 | /* 이미지 데이터 반환 */ 10 | public List getAttachList(int bookId); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/AttachServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.vam.mapper.AttachMapper; 9 | import com.vam.model.AttachImageVO; 10 | 11 | import lombok.extern.log4j.Log4j; 12 | 13 | @Service 14 | @Log4j 15 | public class AttachServiceImpl implements AttachService{ 16 | 17 | @Autowired 18 | private AttachMapper attachMapper; 19 | 20 | 21 | /* 이미지 데이터 반환 */ 22 | @Override 23 | public List getAttachList(int bookId) { 24 | 25 | log.info("getAttachList........."); 26 | 27 | return attachMapper.getAttachList(bookId); 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.AuthorVO; 6 | import com.vam.model.Criteria; 7 | 8 | public interface AuthorService { 9 | 10 | /* 작가 등록 */ 11 | public void authorEnroll(AuthorVO author) throws Exception; 12 | 13 | /* 작가 목록 */ 14 | public List authorGetList(Criteria cri) throws Exception; 15 | 16 | /* 작가 총 수 */ 17 | public int authorGetTotal(Criteria cri) throws Exception; 18 | 19 | /* 작가 상세 페이지 */ 20 | public AuthorVO authorGetDetail(int authorId) throws Exception; 21 | 22 | /* 작가 정보 수정 */ 23 | public int authorModify(AuthorVO author) throws Exception; 24 | 25 | /* 작가 정보 삭제 */ 26 | public int authorDelete(int authorId); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/AuthorServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.vam.mapper.AuthorMapper; 11 | import com.vam.model.AuthorVO; 12 | import com.vam.model.Criteria; 13 | 14 | @Service 15 | public class AuthorServiceImpl implements AuthorService { 16 | 17 | private static final Logger log = LoggerFactory.getLogger(AuthorServiceImpl.class); 18 | 19 | @Autowired 20 | AuthorMapper authorMapper; 21 | 22 | /* 작가 등록 */ 23 | @Override 24 | public void authorEnroll(AuthorVO author) throws Exception { 25 | 26 | authorMapper.authorEnroll(author); 27 | 28 | } 29 | 30 | /* 작가 목록 */ 31 | @Override 32 | public List authorGetList(Criteria cri) throws Exception { 33 | 34 | log.info("(service)authorGetList()......." + cri); 35 | 36 | return authorMapper.authorGetList(cri); 37 | } 38 | 39 | /* 작가 총 수 */ 40 | @Override 41 | public int authorGetTotal(Criteria cri) throws Exception { 42 | log.info("(service)authorGetTotal()......." + cri); 43 | return authorMapper.authorGetTotal(cri); 44 | } 45 | 46 | /* 작가 상세 페이지 */ 47 | @Override 48 | public AuthorVO authorGetDetail(int authorId) throws Exception { 49 | log.info("authorGetDetail........" + authorId); 50 | return authorMapper.authorGetDetail(authorId); 51 | } 52 | 53 | /* 작가 정보 수정 */ 54 | @Override 55 | public int authorModify(AuthorVO author) throws Exception { 56 | log.info("(service) authorModify........." + author); 57 | return authorMapper.authorModify(author); 58 | } 59 | 60 | /* 작가 정보 삭제 */ 61 | @Override 62 | public int authorDelete(int authorId) { 63 | 64 | log.info("authorDelete.........."); 65 | 66 | return authorMapper.authorDelete(authorId); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/BookService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.BookVO; 6 | import com.vam.model.CateFilterDTO; 7 | import com.vam.model.CateVO; 8 | import com.vam.model.Criteria; 9 | import com.vam.model.SelectDTO; 10 | 11 | public interface BookService { 12 | 13 | /* 상품 검색 */ 14 | public List getGoodsList(Criteria cri); 15 | 16 | /* 상품 총 갯수 */ 17 | public int goodsGetTotal(Criteria cri); 18 | 19 | /* 국내 카테고리 리스트 */ 20 | public List getCateCode1(); 21 | 22 | /* 외국 카테고리 리스트 */ 23 | public List getCateCode2(); 24 | 25 | /* 검색결과 카테고리 필터 정보 */ 26 | public List getCateInfoList(Criteria cri); 27 | 28 | /* 상품 정보 */ 29 | public BookVO getGoodsInfo(int bookId); 30 | 31 | /* 상품 id 이름 */ 32 | public BookVO getBookIdName(int bookId); 33 | 34 | /* 평줌순 상품 정보 */ 35 | public List likeSelect(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/CartService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.CartDTO; 6 | 7 | public interface CartService { 8 | 9 | /* 장바구니 추가 */ 10 | public int addCart(CartDTO cart); 11 | 12 | /* 장바구니 정보 리스트 */ 13 | public List getCartList(String memberId); 14 | 15 | /* 카트 수량 수정 */ 16 | public int modifyCount(CartDTO cart); 17 | 18 | /* 카트 삭제 */ 19 | public int deleteCart(int cartId); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/CartServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.vam.mapper.AttachMapper; 9 | import com.vam.mapper.CartMapper; 10 | import com.vam.model.AttachImageVO; 11 | import com.vam.model.CartDTO; 12 | @Service 13 | public class CartServiceImpl implements CartService { 14 | 15 | @Autowired 16 | private CartMapper cartMapper; 17 | 18 | @Autowired 19 | private AttachMapper attachMapper; 20 | 21 | @Override 22 | public int addCart(CartDTO cart) { 23 | 24 | // 장바구니 데이터 체크 25 | CartDTO checkCart = cartMapper.checkCart(cart); 26 | 27 | if(checkCart != null) { 28 | return 2; 29 | } 30 | 31 | // 장바구니 등록 & 에러 시 0반환 32 | try { 33 | return cartMapper.addCart(cart); 34 | } catch (Exception e) { 35 | return 0; 36 | } 37 | 38 | } 39 | 40 | @Override 41 | public List getCartList(String memberId) { 42 | 43 | List cart = cartMapper.getCart(memberId); 44 | 45 | for(CartDTO dto : cart) { 46 | 47 | /* 종합 정보 초기화 */ 48 | dto.initSaleTotal(); 49 | 50 | /* 이미지 정보 얻기 */ 51 | int bookId = dto.getBookId(); 52 | 53 | List imageList = attachMapper.getAttachList(bookId); 54 | 55 | dto.setImageList(imageList); 56 | } 57 | 58 | return cart; 59 | 60 | } 61 | 62 | @Override 63 | public int modifyCount(CartDTO cart) { 64 | 65 | return cartMapper.modifyCount(cart); 66 | } 67 | 68 | @Override 69 | public int deleteCart(int cartId) { 70 | 71 | return cartMapper.deleteCart(cartId); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/MemberService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import com.vam.model.MemberVO; 4 | 5 | public interface MemberService { 6 | 7 | /* 회원가입 */ 8 | public void memberJoin(MemberVO member) throws Exception; 9 | 10 | /* 아이디 중복 검사 */ 11 | public int idCheck(String memberId) throws Exception; 12 | 13 | /* 로그인 */ 14 | public MemberVO memberLogin(MemberVO member) throws Exception; 15 | 16 | /* 주문자 정보 */ 17 | public MemberVO getMemberInfo(String memberId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/MemberServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.vam.mapper.MemberMapper; 7 | import com.vam.model.MemberVO; 8 | 9 | @Service 10 | public class MemberServiceImpl implements MemberService { 11 | 12 | @Autowired 13 | MemberMapper membermapper; 14 | 15 | /* 회원가입 */ 16 | @Override 17 | public void memberJoin(MemberVO member) throws Exception { 18 | 19 | membermapper.memberJoin(member); 20 | 21 | } 22 | 23 | /* 아이디 중복 검사 */ 24 | @Override 25 | public int idCheck(String memberId) throws Exception { 26 | 27 | return membermapper.idCheck(memberId); 28 | } 29 | 30 | /* 로그인 */ 31 | @Override 32 | public MemberVO memberLogin(MemberVO member) throws Exception { 33 | 34 | return membermapper.memberLogin(member); 35 | } 36 | 37 | /* 주문자 정보 */ 38 | @Override 39 | public MemberVO getMemberInfo(String memberId) { 40 | 41 | return membermapper.getMemberInfo(memberId); 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import com.vam.model.OrderCancelDTO; 6 | import com.vam.model.OrderDTO; 7 | import com.vam.model.OrderPageItemDTO; 8 | 9 | public interface OrderService { 10 | 11 | /* 주문 정보 */ 12 | public List getGoodsInfo(List orders); 13 | 14 | /* 주문 */ 15 | public void order(OrderDTO orw); 16 | 17 | /* 주문 취소 */ 18 | public void orderCancle(OrderCancelDTO dto); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/ReplyService.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import com.vam.model.Criteria; 4 | import com.vam.model.ReplyDTO; 5 | import com.vam.model.ReplyPageDTO; 6 | 7 | public interface ReplyService { 8 | 9 | /* 댓글 등록 */ 10 | public int enrollReply(ReplyDTO dto); 11 | 12 | /* 댓글 존재 체크 */ 13 | public String checkReply(ReplyDTO dto); 14 | 15 | /* 댓글 페이징 */ 16 | public ReplyPageDTO replyList(Criteria cri); 17 | 18 | /* 댓글 수정 */ 19 | public int updateReply(ReplyDTO dto); 20 | 21 | /* 댓글 한개 정보(수정페이지) */ 22 | public ReplyDTO getUpdateReply(int replyId); 23 | 24 | /* 댓글 삭제 */ 25 | public int deleteReply(ReplyDTO dto); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/java/com/vam/service/ReplyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.vam.mapper.ReplyMapper; 7 | import com.vam.model.Criteria; 8 | import com.vam.model.PageDTO; 9 | import com.vam.model.ReplyDTO; 10 | import com.vam.model.ReplyPageDTO; 11 | import com.vam.model.UpdateReplyDTO; 12 | 13 | @Service 14 | public class ReplyServiceImpl implements ReplyService{ 15 | 16 | @Autowired 17 | private ReplyMapper replyMapper; 18 | 19 | /* 댓글등록 */ 20 | @Override 21 | public int enrollReply(ReplyDTO dto) { 22 | 23 | int result = replyMapper.enrollReply(dto); 24 | 25 | setRating(dto.getBookId()); 26 | 27 | return result; 28 | } 29 | 30 | /* 댓글 존재 체크 */ 31 | @Override 32 | public String checkReply(ReplyDTO dto) { 33 | 34 | Integer result = replyMapper.checkReply(dto); 35 | 36 | if(result == null) { 37 | return "0"; 38 | } else { 39 | return "1"; 40 | } 41 | 42 | } 43 | 44 | @Override 45 | public ReplyPageDTO replyList(Criteria cri) { 46 | ReplyPageDTO dto = new ReplyPageDTO(); 47 | 48 | dto.setList(replyMapper.getReplyList(cri)); 49 | dto.setPageInfo(new PageDTO(cri, replyMapper.getReplyTotal(cri.getBookId()))); 50 | 51 | return dto; 52 | } 53 | 54 | @Override 55 | public int updateReply(ReplyDTO dto) { 56 | 57 | int result = replyMapper.updateReply(dto); 58 | 59 | setRating(dto.getBookId()); 60 | 61 | return result; 62 | } 63 | 64 | @Override 65 | public ReplyDTO getUpdateReply(int replyId) { 66 | 67 | return replyMapper.getUpdateReply(replyId); 68 | } 69 | 70 | @Override 71 | public int deleteReply(ReplyDTO dto) { 72 | 73 | int result = replyMapper.deleteReply(dto.getReplyId()); 74 | 75 | setRating(dto.getBookId()); 76 | 77 | return result; 78 | } 79 | 80 | public void setRating(int bookId) { 81 | 82 | Double ratingAvg = replyMapper.getRatingAverage(bookId); 83 | 84 | if(ratingAvg == null) { 85 | ratingAvg = 0.0; 86 | } 87 | 88 | ratingAvg = (double) (Math.round(ratingAvg*10)); 89 | ratingAvg = ratingAvg / 10; 90 | 91 | UpdateReplyDTO urd = new UpdateReplyDTO(); 92 | urd.setBookId(bookId); 93 | urd.setRatingAvg(ratingAvg); 94 | 95 | replyMapper.updateRating(urd); 96 | 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/com/vam/mapper/AttachMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/com/vam/mapper/AuthorMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_author(authorName, nationId, authorIntro) values(#{authorName}, #{nationId}, #{authorIntro} ) 11 | 12 | 13 | 14 | 15 | 16 | 27 | 28 | 29 | 40 | 41 | 42 | 47 | 48 | 49 | 50 | 51 | update vam_author set authorName=#{authorName}, nationId=#{nationId}, authorIntro=#{authorIntro}, updatedate=now() where authorId = #{authorId} 52 | 53 | 54 | 55 | 56 | 57 | 58 | delete from vam_author where authorId = #{authorId} 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/com/vam/mapper/CartMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_cart(memberId, bookId, bookCount) 11 | values(#{memberId}, #{bookId}, #{bookCount}) 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | delete from vam_cart where cartId = #{cartId} 20 | 21 | 22 | 23 | 24 | 25 | 26 | update vam_cart set bookCount=#{bookCount} where cartId = #{cartId} 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | delete from vam_cart where memberId = #{memberId} and bookId = #{bookId} 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/com/vam/mapper/MemberMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into book_member values(#{memberId}, #{memberPw}, #{memberName}, #{memberMail}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, 0, sysdate(), 100000, 5000 ) 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 29 | 30 | 31 | 38 | 39 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/com/vam/mapper/OrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | insert into vam_order(orderId, addressee, memberId, memberAddr1, memberAddr2, memberAddr3, orderState, deliveryCost, usePoint) 26 | values(#{orderId},#{addressee}, #{memberId}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, '배송준비', #{deliveryCost}, #{usePoint}) 27 | 28 | 29 | 30 | 31 | 32 | 33 | insert into vam_orderItem(orderId, bookId, bookCount, bookPrice, bookDiscount, savePoint) 34 | values(#{orderId}, #{bookId}, #{bookCount}, #{bookPrice}, #{bookDiscount}, #{savePoint}) 35 | 36 | 37 | 38 | 39 | 40 | 41 | update book_member set money = #{money}, point = #{point} where memberid = #{memberId} 42 | 43 | 44 | 45 | 46 | 47 | 48 | update vam_book set bookStock = #{bookStock} where bookId = #{bookId} 49 | 50 | 51 | 52 | 53 | 54 | 55 | update vam_order set orderState = '주문취소' where orderId = #{orderId} 56 | 57 | 58 | 59 | 60 | 66 | 67 | 68 | 74 | 75 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/com/vam/mapper/ReplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating}) 11 | 12 | 13 | 14 | 20 | 21 | 22 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | update vam_reply set content = #{content}, rating = #{rating} 44 | where replyId = #{replyId} 45 | 46 | 47 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | DELETE FROM vam_reply 60 | WHERE replyId = #{replyId} 61 | 62 | 63 | 64 | 71 | 72 | 73 | 74 | update vam_book 75 | set ratingAvg = #{ratingAvg} 76 | where bookId = #{bookId} 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/resources/log4jdbc.log4j2.properties: -------------------------------------------------------------------------------- 1 | log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/spring/appServlet/security-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/views/admin/main.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 14 | 15 | 16 | 17 | <%@include file="../includes/admin/header.jsp" %> 18 | 19 |
20 |
관리자 페이지 입니다.
21 |
22 | 23 | <%@include file="../includes/admin/footer.jsp" %> 24 | 25 | 26 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 | <%@ page session="false" %> 3 | 4 | 5 | Home 6 | 7 | 8 |

9 | Hello world! 10 |

11 | 12 |

The time on the server is ${serverTime}.

13 | 14 | 15 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/views/includes/admin/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 |
4 |
5 | 6 | 7 | 23 | 24 | 43 | 44 |
45 |
-------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/views/includes/admin/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 |
5 |
6 | 7 |
8 | 13 |
14 | 15 |
16 | 관리자 페이지 17 | 18 |
19 | 20 |
21 | 22 |
23 | 43 |
-------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/views/member/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 |
21 |
22 | Book Mall 23 |
24 | 44 |
45 | 46 |
47 | 48 |
49 | 50 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | contextConfigLocation 9 | /WEB-INF/spring/root-context.xml 10 | 11 | 12 | 13 | 14 | org.springframework.web.context.ContextLoaderListener 15 | 16 | 17 | 18 | 19 | appServlet 20 | org.springframework.web.servlet.DispatcherServlet 21 | 22 | contextConfigLocation 23 | 24 | /WEB-INF/spring/appServlet/servlet-context.xml 25 | /WEB-INF/spring/appServlet/security-context.xml 26 | 27 | 28 | 1 29 | 30 | 31 | 32 | C:\\upload\\temp 33 | 20971520 34 | 41943040 35 | 20971520 36 | 37 | 38 | 39 | 40 | 41 | appServlet 42 | / 43 | 44 | 45 | 46 | encodingFilter 47 | 48 | org.springframework.web.filter.CharacterEncodingFilter 49 | 50 | 51 | encoding 52 | UTF-8 53 | 54 | 55 | forceEncoding 56 | true 57 | 58 | 59 | 60 | encodingFilter 61 | /* 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/css/admin/authorPop.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /* 전체 wrap */ 4 | .wrapper{ 5 | width:100%; 6 | height:535px; 7 | } 8 | .subject_name_warp{ 9 | font-size: 33px; 10 | font-weight: bolder; 11 | padding-left: 15px; 12 | background-color: #6AAFE6; 13 | height: 13%; 14 | line-height: 70px; 15 | color: white; 16 | } 17 | .content_wrap{ 18 | height:87%; 19 | } 20 | 21 | 22 | 23 | 24 | /* 작가 목록 영역 */ 25 | .author_table_wrap{ 26 | padding: 20px 35px 27 | } 28 | .table_exist{ 29 | height:251px; 30 | } 31 | .author_table{ 32 | width: 100%; 33 | border: 1px solid #d3d8e1; 34 | text-align: center; 35 | border-collapse: collapse; 36 | } 37 | .author_table td{ 38 | padding: 10px 5px; 39 | border : 1px solid #e9ebf0; 40 | } 41 | .author_table thead{ 42 | background-color: #f8f9fd; 43 | font-weight: 600; 44 | } 45 | .author_table a{ 46 | color:#1088ed; 47 | font-weight: 500; 48 | } 49 | .th_column_1{ 50 | width:120px; 51 | } 52 | .th_column_3{ 53 | width:110px; 54 | } 55 | 56 | 57 | .table_empty{ 58 | text-align: center; 59 | margin: 101px 0 130px 0; 60 | font-size: 25px; 61 | } 62 | 63 | /* 검색 영역 */ 64 | .search_wrap{ 65 | margin-top:25px; 66 | } 67 | .search_input{ 68 | position: relative; 69 | text-align:center; 70 | } 71 | .search_input input[name='keyword']{ 72 | padding: 4px 10px; 73 | font-size: 15px; 74 | height: 20px; 75 | line-height: 20px; 76 | } 77 | .search_btn{ 78 | height: 32px; 79 | width: 80px; 80 | font-weight: 600; 81 | font-size: 18px; 82 | line-height: 20px; 83 | position: absolute; 84 | margin-left: 15px; 85 | background-color: #c3daf7; 86 | } 87 | 88 | /* 페이지 버튼 인터페이스 */ 89 | .pageMaker_wrap{ 90 | margin-top: 20px; 91 | margin-bottom: 40px; 92 | } 93 | .pageMaker{ 94 | list-style: none; 95 | display: inline-block; 96 | } 97 | .pageMaker_btn { 98 | text-align: center; 99 | float: left; 100 | width: 30px; 101 | height: 30px; 102 | line-height: 30px; 103 | margin-left: 8px; 104 | font-size: 15px; 105 | } 106 | .active{ 107 | border : 2px solid black; 108 | font-weight:400; 109 | } 110 | .next, .prev { 111 | border: 1px solid #ccc; 112 | padding: 0 10px; 113 | } 114 | .next a, .prev a { 115 | color: #ccc; 116 | } -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/css/member/login.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | *{ 3 | margin: 0; 4 | padding:0; 5 | } 6 | 7 | /* 화면 전체 렙 */ 8 | .wrapper{ 9 | width: 100%; 10 | } 11 | 12 | /* content 랩 */ 13 | .wrap{ 14 | width : 800px; 15 | margin: auto; 16 | } 17 | 18 | /* 페이지 로고 */ 19 | .logo_wrap{ 20 | text-align: center; 21 | margin: 150px 0; 22 | } 23 | .logo_wrap>span{ 24 | font-size : 50px; 25 | font-weight: 900; 26 | } 27 | 28 | 29 | /* 로그인 area */ 30 | .id_input_box{ 31 | border: 1px solid black; 32 | height:31px; 33 | padding: 10px 14px; 34 | display: block; 35 | width : 80%; 36 | margin : auto; 37 | } 38 | .id_input{ 39 | width:100%; 40 | height:100%; 41 | border:none; 42 | font-size:28px; 43 | } 44 | 45 | 46 | .pw_wrap{ 47 | margin-top: 40px; 48 | } 49 | .pw_input_box{ 50 | border: 1px solid black; 51 | height:31px; 52 | padding: 10px 14px; 53 | display: block; 54 | width : 80%; 55 | margin : auto; 56 | } 57 | .pw_iput{ 58 | width:100%; 59 | height:100%; 60 | border:none; 61 | font-size:28px; 62 | } 63 | 64 | 65 | .login_button_wrap{ 66 | margin-top: 40px; 67 | text-align: center; 68 | } 69 | .login_button{ 70 | width: 84%; 71 | height: 80px; 72 | background-color: #6AAFE6; 73 | font-size: 40px; 74 | font-weight: 900; 75 | color: white; 76 | margin : auto; 77 | } 78 | 79 | /* 로그인 실패시 경고글 */ 80 | .login_warn{ 81 | margin-top: 30px; 82 | text-align: center; 83 | color : red; 84 | } 85 | 86 | /* float 속성 해제 */ 87 | .clearfix{ 88 | clear: both; 89 | } 90 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/img/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa_MySQL/src/main/webapp/resources/img/Logo.png -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/img/bnA_w01_a8daff.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa_MySQL/src/main/webapp/resources/img/bnA_w01_a8daff.jpg -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/img/bnD_w01_c3c5f7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa_MySQL/src/main/webapp/resources/img/bnD_w01_c3c5f7.jpg -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/img/bnK_w01_c3c5f7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa_MySQL/src/main/webapp/resources/img/bnK_w01_c3c5f7.jpg -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/img/goodsNoImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa_MySQL/src/main/webapp/resources/img/goodsNoImage.png -------------------------------------------------------------------------------- /VamPa_MySQL/src/main/webapp/resources/img/mLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjinjin7/Blog_Project/46d5a1bfe2d584e3001fc6925007b40ed118df56/VamPa_MySQL/src/main/webapp/resources/img/mLogo.png -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/mapper/AttachMapperTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 11 | public class AttachMapperTests { 12 | 13 | @Autowired 14 | private AttachMapper attachMapper; 15 | 16 | /*이미지 정보 반환*/ 17 | @Test 18 | public void getAttachListTests() { 19 | 20 | int bookId = 3076; 21 | 22 | System.out.println("이미지 정보 : " + attachMapper.getAttachList(bookId)); 23 | 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/mapper/CartMapperTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 10 | public class CartMapperTests { 11 | 12 | @Autowired 13 | private CartMapper mapper; 14 | 15 | /*카트 등록*/ 16 | /* 17 | @Test 18 | public void addCart() { 19 | String memberId = "admin"; 20 | int bookId = 65; 21 | int count = 2; 22 | 23 | CartDTO cart = new CartDTO(); 24 | cart.setMemberId(memberId); 25 | cart.setBookId(bookId); 26 | cart.setBookCount(count); 27 | 28 | int result = 0; 29 | try { 30 | result = mapper.addCart(cart); 31 | } catch (Exception e) { 32 | System.out.println("에러 발생"); 33 | } 34 | 35 | System.out.println("결과 : " + result); 36 | 37 | } 38 | */ 39 | 40 | /* 카트 삭제 */ 41 | /* 42 | @Test 43 | public void deleteCartTest() { 44 | int cartId = 1; 45 | 46 | mapper.deleteCart(cartId); 47 | } 48 | */ 49 | 50 | /* 카트 수량 수정 */ 51 | /* 52 | @Test 53 | public void modifyCartTest() { 54 | int cartId = 3; 55 | int count = 5; 56 | 57 | CartDTO cart = new CartDTO(); 58 | cart.setCartId(cartId); 59 | cart.setBookCount(count); 60 | 61 | mapper.modifyCount(cart); 62 | 63 | } 64 | */ 65 | 66 | /* 67 | @Test 68 | public void getCartTest() { 69 | String memberId = "admin"; 70 | 71 | 72 | List list = mapper.getCart(memberId); 73 | for(CartDTO cart : list) { 74 | System.out.println(cart); 75 | cart.initSaleTotal(); 76 | System.out.println("init cart : " + cart); 77 | } 78 | 79 | 80 | 81 | } 82 | */ 83 | 84 | /* 카트 확인 */ 85 | /* 86 | @Test 87 | public void checkCartTest() { 88 | 89 | String memberId = "admin"; 90 | int bookId = 71; 91 | 92 | CartDTO cart = new CartDTO(); 93 | cart.setMemberId(memberId); 94 | cart.setBookId(bookId); 95 | 96 | CartDTO resutlCart = mapper.checkCart(cart); 97 | System.out.println("결과 : " + resutlCart); 98 | 99 | } 100 | */ 101 | 102 | } 103 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/mapper/MemberMapperTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.mapper; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import com.vam.model.MemberVO; 10 | 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 13 | public class MemberMapperTests { 14 | 15 | @Autowired 16 | private MemberMapper membermapper; //MemberMapper.java 인터페이스 의존성 주입 17 | 18 | /* 회원가입 쿼리 테스트 메서드 */ 19 | /* 20 | @Test 21 | public void memberJoin() throws Exception{ 22 | MemberVO member = new MemberVO(); 23 | 24 | member.setMemberId("test"); //회원 id 25 | member.setMemberPw("test"); //회원 비밀번호 26 | member.setMemberName("test"); //회원 이름 27 | member.setMemberMail("test"); //회원 메일 28 | member.setMemberAddr1("test"); //회원 우편번호 29 | member.setMemberAddr2("test"); //회원 주소 30 | member.setMemberAddr3("test"); //회원 상세주소 31 | 32 | membermapper.memberJoin(member); //쿼리 메서드 실행 33 | 34 | } 35 | */ 36 | 37 | 38 | /*아이디 중복검사*/ 39 | /* 40 | @Test 41 | public void memberIdChk() throws Exception{ 42 | String id = "admin"; // 존재하는 아이디 43 | String id2 = "test123"; // 존재하지 않는 아이디 44 | membermapper.idCheck(id); 45 | membermapper.idCheck(id2); 46 | } 47 | */ 48 | 49 | 50 | /* 로그인 쿼리 mapper 메서드 테스트 */ 51 | @Test 52 | public void memberLogin() throws Exception{ 53 | 54 | MemberVO member = new MemberVO(); // MemberVO 변수 선언 및 초기화 55 | 56 | /* 올바른 아이디 비번 입력경우 */ 57 | //member.setMemberId("test1"); 58 | //member.setMemberPw("test1"); 59 | 60 | /* 올바른 않은 아이디 비번 입력경우 */ 61 | member.setMemberId("test1123"); 62 | member.setMemberPw("test1321321"); 63 | 64 | membermapper.memberLogin(member); 65 | System.out.println("결과 값 : " + membermapper.memberLogin(member)); 66 | 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/persistence/DataSourceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.persistence; 2 | 3 | import java.sql.Connection; 4 | 5 | import javax.sql.DataSource; 6 | 7 | import org.apache.ibatis.session.SqlSession; 8 | import org.apache.ibatis.session.SqlSessionFactory; 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.test.context.ContextConfiguration; 13 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 17 | public class DataSourceTests { 18 | 19 | @Autowired 20 | private DataSource dataSource; 21 | 22 | @Autowired 23 | private SqlSessionFactory sqlSessionFactory; 24 | 25 | @Test 26 | public void testConnection() { 27 | try( 28 | Connection con = dataSource.getConnection(); 29 | SqlSession session = sqlSessionFactory.openSession(); 30 | ){ 31 | 32 | System.out.println("con=" + con); 33 | System.out.println("session=" + session); 34 | 35 | }catch(Exception e) { 36 | e.printStackTrace(); 37 | } 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/persistence/JDBCTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.persistence; 2 | 3 | import static org.junit.Assert.fail; 4 | 5 | import java.sql.Connection; 6 | import java.sql.DriverManager; 7 | 8 | import org.junit.Test; 9 | 10 | public class JDBCTests { 11 | 12 | static { 13 | try { 14 | Class.forName("com.mysql.cj.jdbc.Driver"); 15 | } catch(Exception e) { 16 | e.printStackTrace(); 17 | } 18 | } 19 | 20 | @Test 21 | public void testConnection() { 22 | 23 | try(Connection con = 24 | DriverManager.getConnection( 25 | "jdbc:mysql://localhost:3306/ksj?serverTimezone=Asia/Seoul", 26 | "root", 27 | "1234")){ 28 | System.out.println(con); 29 | } catch (Exception e) { 30 | fail(e.getMessage()); 31 | } 32 | 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/sample/SampleTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.sample; 2 | 3 | import static org.junit.Assert.assertNotNull; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.test.context.ContextConfiguration; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | 11 | import lombok.extern.log4j.Log4j; 12 | 13 | @RunWith(SpringJUnit4ClassRunner.class) 14 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 15 | @Log4j 16 | public class SampleTests { 17 | 18 | @Autowired 19 | private Restaurant restaurant; 20 | 21 | @Test 22 | public void textExit() { 23 | 24 | assertNotNull(restaurant); 25 | 26 | log.info(restaurant); 27 | log.info("-----------------------------------"); 28 | log.info(restaurant.getChef()); 29 | 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/service/AdminServiceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import com.vam.model.AttachImageVO; 13 | import com.vam.model.BookVO; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 17 | public class AdminServiceTests { 18 | 19 | @Autowired 20 | private AdminService service; 21 | 22 | 23 | /* 상품 등록 & 상품 이미지 등록 테스트 */ 24 | @Test 25 | public void bookEnrollTEsts() { 26 | 27 | BookVO book = new BookVO(); 28 | // 상품 정보 29 | book.setBookName("mapper 테스트"); 30 | book.setAuthorId(8); 31 | book.setPubleYear("2021-03-18"); 32 | book.setPublisher("출판사"); 33 | book.setCateCode("202001"); 34 | book.setBookPrice(20000); 35 | book.setBookStock(300); 36 | book.setBookDiscount(0.23); 37 | book.setBookIntro("책 소개 "); 38 | book.setBookContents("책 목차 "); 39 | 40 | // 이미지 정보 41 | List imageList = new ArrayList(); 42 | 43 | AttachImageVO image1 = new AttachImageVO(); 44 | AttachImageVO image2 = new AttachImageVO(); 45 | 46 | image1.setFileName("test Image 1"); 47 | image1.setUploadPath("test image 1"); 48 | image1.setUuid("test1111"); 49 | 50 | image2.setFileName("test Image 2"); 51 | image2.setUploadPath("test image 2"); 52 | image2.setUuid("test2222"); 53 | 54 | imageList.add(image1); 55 | imageList.add(image2); 56 | 57 | 58 | book.setImageList(imageList); 59 | 60 | // bookEnroll() 메서드 호출 61 | service.bookEnroll(book); 62 | 63 | System.out.println("등록된 VO : " + book); 64 | 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/service/AuthorServiceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import java.util.List; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.test.context.ContextConfiguration; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | 11 | import com.vam.model.AuthorVO; 12 | import com.vam.model.Criteria; 13 | 14 | 15 | 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 18 | public class AuthorServiceTests { 19 | 20 | /*AuthoreService 의존성 주입*/ 21 | @Autowired 22 | private AuthorService service; 23 | /* 24 | @Test 25 | public void authorEnrollTest() throws Exception { 26 | 27 | AuthorVO author = new AuthorVO(); 28 | 29 | author.setNationId("01"); 30 | author.setAuthorName("테스트"); 31 | author.setAuthorIntro("테스트 소개"); 32 | 33 | service.authorEnroll(author); 34 | 35 | } 36 | */ 37 | 38 | /* 작가 목록 구현 */ 39 | /* 40 | @Test 41 | public void authorGetListTest() throws Exception{ 42 | 43 | Criteria cri = new Criteria(3, 10); 44 | 45 | List list = service.authorGetList(cri); 46 | 47 | for(int i = 0; i < list.size(); i++) { 48 | System.out.println("list" + i + "......." + list.get(i)); 49 | } 50 | 51 | } 52 | */ 53 | 54 | /*작가 상세 페이지*/ 55 | /* 56 | @Test 57 | public void authorGetDetailTest() throws Exception{ 58 | 59 | int authorId = 20; 60 | 61 | Log.info("author......" + service.authorGetDetail(authorId)); 62 | 63 | } 64 | */ 65 | 66 | /* 작가 정보 수정 */ 67 | @Test 68 | public void authorModifyTest() throws Exception { 69 | 70 | AuthorVO author = new AuthorVO(); 71 | 72 | author.setAuthorId(1); 73 | System.out.println("(service)수정 전...................." + service.authorGetDetail(author.getAuthorId())); 74 | 75 | author.setAuthorName("(service)수정"); 76 | author.setNationId("01"); 77 | author.setAuthorIntro("(service)소개 수정 하였습니다."); 78 | 79 | service.authorModify(author); 80 | System.out.println("(service)수정 후...................." + service.authorGetDetail(author.getAuthorId())); 81 | 82 | } 83 | 84 | 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/java/com/vam/service/CartServiceTests.java: -------------------------------------------------------------------------------- 1 | package com.vam.service; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import com.vam.model.CartDTO; 10 | 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml") 13 | public class CartServiceTests { 14 | 15 | @Autowired 16 | private CartService service; 17 | 18 | //등록 테스트 19 | @Test 20 | public void addCartTest() { 21 | //given 22 | String memberId = "admin"; 23 | int bookId = 22; 24 | int count = 5; 25 | 26 | CartDTO dto = new CartDTO(); 27 | dto.setMemberId(memberId); 28 | dto.setBookId(bookId); 29 | dto.setBookCount(count); 30 | 31 | //when 32 | int result = service.addCart(dto); 33 | 34 | //then 35 | System.out.println("** result : " + result); 36 | 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /VamPa_MySQL/src/test/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/com/vam/mapper/AttachMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/com/vam/mapper/AuthorMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_author(authorName, nationId, authorIntro) values(#{authorName}, #{nationId}, #{authorIntro} ) 11 | 12 | 13 | 14 | 15 | 16 | 27 | 28 | 29 | 40 | 41 | 42 | 47 | 48 | 49 | 50 | 51 | update vam_author set authorName=#{authorName}, nationId=#{nationId}, authorIntro=#{authorIntro}, updatedate=now() where authorId = #{authorId} 52 | 53 | 54 | 55 | 56 | 57 | 58 | delete from vam_author where authorId = #{authorId} 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/com/vam/mapper/CartMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_cart(memberId, bookId, bookCount) 11 | values(#{memberId}, #{bookId}, #{bookCount}) 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | delete from vam_cart where cartId = #{cartId} 20 | 21 | 22 | 23 | 24 | 25 | 26 | update vam_cart set bookCount=#{bookCount} where cartId = #{cartId} 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 47 | 48 | 49 | 50 | delete from vam_cart where memberId = #{memberId} and bookId = #{bookId} 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/com/vam/mapper/MemberMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into book_member values(#{memberId}, #{memberPw}, #{memberName}, #{memberMail}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, 0, sysdate(), 100000, 5000 ) 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 29 | 30 | 31 | 38 | 39 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/com/vam/mapper/OrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | insert into vam_order(orderId, addressee, memberId, memberAddr1, memberAddr2, memberAddr3, orderState, deliveryCost, usePoint) 26 | values(#{orderId},#{addressee}, #{memberId}, #{memberAddr1}, #{memberAddr2}, #{memberAddr3}, '배송준비', #{deliveryCost}, #{usePoint}) 27 | 28 | 29 | 30 | 31 | 32 | 33 | insert into vam_orderItem(orderId, bookId, bookCount, bookPrice, bookDiscount, savePoint) 34 | values(#{orderId}, #{bookId}, #{bookCount}, #{bookPrice}, #{bookDiscount}, #{savePoint}) 35 | 36 | 37 | 38 | 39 | 40 | 41 | update book_member set money = #{money}, point = #{point} where memberid = #{memberId} 42 | 43 | 44 | 45 | 46 | 47 | 48 | update vam_book set bookStock = #{bookStock} where bookId = #{bookId} 49 | 50 | 51 | 52 | 53 | 54 | 55 | update vam_order set orderState = '주문취소' where orderId = #{orderId} 56 | 57 | 58 | 59 | 60 | 66 | 67 | 68 | 74 | 75 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/com/vam/mapper/ReplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | insert into vam_reply(bookId, memberId, content, rating) values(#{bookId}, #{memberId}, #{content}, #{rating}) 11 | 12 | 13 | 14 | 20 | 21 | 22 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | update vam_reply set content = #{content}, rating = #{rating} 44 | where replyId = #{replyId} 45 | 46 | 47 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | DELETE FROM vam_reply 60 | WHERE replyId = #{replyId} 61 | 62 | 63 | 64 | 71 | 72 | 73 | 74 | update vam_book 75 | set ratingAvg = #{ratingAvg} 76 | where bookId = #{bookId} 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/classes/log4jdbc.log4j2.properties: -------------------------------------------------------------------------------- 1 | log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator -------------------------------------------------------------------------------- /VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: sjinj 3 | Build-Jdk: 15.0.1 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Tue Feb 22 01:43:38 KST 2022 3 | m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project2\\VamPa_MySQL 4 | m2e.projectName=VamPa_MySQL 5 | groupId=com.vam 6 | artifactId=controller 7 | version=1.0.0-BUILD-SNAPSHOT 8 | -------------------------------------------------------------------------------- /VamPa_MySQL/target/test-classes/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | --------------------------------------------------------------------------------