2024/08/05 7

[SpringBoot] 7. Exception Handler 처리

1. @ControllerAdvice와 @RestcontrollerAdvice(1) 개념 (2) 차이점 2. 코드(1) RedirectExceptionpackage com.tenco.bank.handler.Exception;import org.springframework.http.HttpStatus;import lombok.Getter;@Getter// 에러 발생 시에 여러 페이지로 이동시킬 때 사용 예정public class RedirectException extends RuntimeException{ private HttpStatus status; // throw new RedirectException(???,???); public RedirectException(String message,Http..

Springboot 2024.08.05

[SpringBoot] 6. 메인컨트롤러와 메인페이지 구현하기

1. 프레임워크와 라이브러리의 개념 2. IoC의 개념(제어의 역전 3. 프레임워크로 구현하기(1) 메인 컨트롤러(mainController.java)package com.tenco.bank.controller;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.GetMapping;@Controller // IoC의 대상(싱글톤 패턴으로 관리된다.)// IoC = inversion of controll (=제어의 역전)public class MainController { // REST API 기반으로 주소 설계 가능 // 주소 설계 // http://localhost:8080/mai..

Springboot 2024.08.05

[SpringBoot] 4. 모델링(1) - DB 모델링

1. 모델링의 개념* 데이터 베이스 모델링은 데이터 구조에 핵심을 둬야 한다! 2. ORM과 TRM 방식(1) ORM(Object-Relational Mapping)(2) TRM(Table-Relational Mapping) 3. DB 설계(1) DB 설계 쿼리-- 데이터베이스 생성-- mybankcreate database mybank;use mybank;-- 외래키 지정 안 함... (only 컬럼)-- 유저 테이블 설계create table user_tb( id int auto_increment primary key, username varchar(50) not null unique key, password varchar(100) not null, fullname varchar(50..

Springboot 2024.08.05