Coder Social home page Coder Social logo

shopproject's Introduction

toyProject shopProject

1. 설계도

  • front = html, js, jquery, bootstrap
  • back = jpa, spring boot
  • DB = H2-Database
Database 테이블
  • 회원 (Account)
  • 메뉴 (Menu)
  • 장바구니 (Cart, CartItem)
  • 주문 (Order)
  • 결제 (Payment)
Database 테이블 다이어그램

스크린샷 2022-04-15 오후 1 42 21

프로젝트 패키지 구성도

스크린샷 2022-04-15 오후 2 33 17

서비스 흐름
  • 로그인 -> 장바구니 담기 -> 주문 -> 주문한 장바구니 목록 삭제 -> 결제 -> 주문한 목록들 삭제

2.실행코드

1.entity 클래스

  • account

    스크린샷 2022-04-15 오후 2 39 02
  • menu

    스크린샷 2022-04-15 오후 2 39 53
  • cart

    스크린샷 2022-04-15 오후 2 39 20
  • cartItem

    스크린샷 2022-04-15 오후 2 39 34
  • order

    스크린샷 2022-04-15 오후 2 40 17
  • payment

    스크린샷 2022-04-15 오후 2 40 34

2.첫 등록 데이터베이스 작업

로그인/로그아웃에 필요한 User 등록

IninDB.class

스크린샷 2022-04-15 오후 1 52 24

@PostConstruct WAS가 올라가면서 bean이 생성될 때 딱 한 번 초기화함 bean lifecycle에서 오직 한 번만 수행된다는 것을 보장할 수 있다.

메뉴 10개 등록

data.sql

스크린샷 2022-04-15 오후 1 55 45

메뉴에 대한 데이터들도 InitDB 에서 insert 할려 했으나 sql을 통한 db insert 로 하는 방법도 같이 구현 해보고 싶었다.

  1. security

스크린샷 2022-04-15 오후 2 23 19

  • 권한이 필요없는 url 들은 permitAll() 로 지정해 주었고 나머지느 로그인 인증을 통해 접속이 가능하게 하였다.
  • exceptionHandling().authenticationEntryPoint(ajaxAwareAuthenticationEntryPoint("/login")) 부분은 ajax 통신을 통한 웹형식으로 되어있어 인증이 거치지 않은 유저는 403 status 를 보내 로그인 페이지로 이동 시키는 필터기능을 하고있다.

스크린샷 2022-04-15 오후 2 31 46

스크린샷 2022-04-15 오후 2 31 00

  1. cart service code
  • 장바구니 담기 code

    스크린샷 2022-04-15 오후 2 48 19
  • 장바구니 삭제 code

    스크린샷 2022-04-15 오후 2 49 20
  1. order service code
  • 주문 완료 code

    스크린샷 2022-04-15 오후 6 12 09
  • 주문 삭제 code

    스크린샷 2022-04-15 오후 2 52 07
  1. payment service code
  • 결제 완료 code

    스크린샷 2022-04-15 오후 2 53 09

3.실행 동영상

https://youtu.be/GNen1sT3pWw

shopproject's People

Contributors

ggmcjy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.