My footsteps

BACK @Autowired private RestaurantService1 service; //리스트 전체 뽑기 @GetMapping("list") public ResponseEntity list( @RequestParam(name="q",required = false)String name, @RequestParam(name="c",required = false)Integer categoryId, @RequestParam(name="f",required = false)Integer filterId ){ List list = null; if(name != null) list = service.getListByName(name); else if(categoryId != null) list = service..

- ${ } 는 안에 있는 값을 있는 그대로 반환해준다 - ref 는 객체 하나만 담을수 있음 리액티브는 여러개를 담을수 있음 ResponseEntity 커스텀 - response Exc 클래스를 만들어서 response를 보낼때의 예외까지 생각해서 코드를 집중화 한다? - response Exc클래스로 에러와 response 메세지를 관리할수있다 ❓DTO : Data Transfer Object 의 약자로, 계층 간 데이터 전송을 위해 도메인 모델 대신 사용되는 객체 이다. 이때, 계층이란 Presentation(View, Controller), Business(Service), Persistence(DAO, Repository) 등을 의미한다. 참고) https://sh970901.tistory.co..

BACK @RestController @RequestMapping("api/category") public class CategoryController1 { @Autowired private CategoryService1 service; //리스트,C(add),R(id찾기),U(업데이트),D(삭제) @GetMapping("list") //ResponseEntity의 데이터 타입이 //List의 데이터 타입이 Category public ResponseEntity list(){ List list = service.getList(); return Exc.handleException(list); } //R @GetMapping("{id}") //다 가져올 필요가 없으니까 public ResponseEntity..

- url과 관계없이 http 데이터 통신을 위한 url = 레스트풀에이피아이 @RestController 면 무조건 ("api/어쩌구") 이렇게 적어야한다 - 제네릭 https://seeminglyjs.tistory.com/184 [Java] 자바 타입 제네릭(Generic) 쉽게 알아보기 2020-12-03 제네릭(Generic) 은 클래스 / 인터페이스 / 메서드 등의 타입을 파라미터로 사용할 수 있게 해주는 역할을 한다. 또한 비제네릭 타입의 코드에서 발생하는 불필요한 타입 변환으로 인한 프 seeminglyjs.tistory.com - http 메세지에서 body에는 실제 데이터가 들어간다 - controller에서 보내는 url이랑 fetch( ) 들어있는 url 이랑 매칭되는것 -..

- 요청헤더에는 url 정보가 들어간다 - api는 데이터 매핑용이다(url이아님) ResponseEntity 이거는 상태코드를 우리가 클라이언트에게 반환할수 있다. 이걸 갖고 프론트단에서 조건처리를 할수있음 - A페이지에서 B페이지로 넘어가게 하는게 라우팅 - 프론트의 예외처리 onMounted(()=>{ fetch(`http://localhost:8080/restaurant/160/menu`) .then(response=>{ if(!response.ok) throw new Error("오류인거셈!!") return response.json() }) .then(list=>{ console.log(list); }) .catch(error=>{ console.log(error); }) }) - 타임리프의 ..