헤더 컴포넌트 문의
해결됨
Nuxt.js 시작하기
디폴트 레이아웃 하위에서 헤더와 nuxt link가 존재하는데요 이런경우 헤더영역을 헤더 컴포넌트로 빼서 컴포넌트 하위에 두고 레이아웃에서 호출해서 사용하는게 일반적인가요? 넉스트에서 레이아웃은 조금 특수한 pages 같아서 문의드립니다
- vue.js
- nuxt.js
- ssr
172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
Nuxt.js 시작하기
디폴트 레이아웃 하위에서 헤더와 nuxt link가 존재하는데요 이런경우 헤더영역을 헤더 컴포넌트로 빼서 컴포넌트 하위에 두고 레이아웃에서 호출해서 사용하는게 일반적인가요? 넉스트에서 레이아웃은 조금 특수한 pages 같아서 문의드립니다
해결됨
Nuxt.js 시작하기
안녕하세요 혹시 유튜브 상단의 검색 컴포넌트 처럼 데이터 바인딩이 필요한 부분도 레이아웃에 배치하는것이 일반적인가요?
미해결
탄탄한 백엔드 NestJS, 기초부터 심화까지
안녕하세요. 상석님! 상석님의 강의를 듣고 공식문서와 typeorm, mongoose등의 공식문서를 함께 이용하여 nest 프로젝트를 제작중인 1년차 node js 개발자입니다. 강의 너무 잘 들었습니다. 개인적으로 프로젝트를 진행하는 중 dto파일과 entity를 어떻게 관리하면 수월할까 라는 고민을 깊게 하게 되었습니다. chat gpt나 스택오버 플로우, 구글 등 많은 검색을 해봤지만 제 실력이 부족한지 정보를 찾기가 힘들어 여쭤보게 되었습니다. export class CreateRequestPostDto { @ApiProperty({ example: 'youtube uri', name: 'youtubeUri' }) @IsUrl() uri: string; @ApiProperty({ example: 'postTitle writed for user' }) @IsString() postTitle: string; @ApiProperty({ example: 'postDescription writed for user' }) @IsString() postDescription: string; } export class UpdatePostDto { @ApiProperty({ example: 'postTitle writed for user' }) @IsString() postTitle: string; @ApiProperty({ example: 'postDescription writed for user' }) @IsString() postDescription: string; } 위는 제가 만들고 있는 프로젝트의 일부입니다. postTitle과 postDescription이 두 클래스에서 중복이 되는 케이스인데 상속을 이용해서 postTitle과 postDescription을 따로 빼는 방법은 제가 원하는 방향이 아닙니다. 저는 기본적인 base dto클래스를 하나 만들어 놓고 이를 재활용하는 방법을 사용하고 싶습니다. export class BasePostClass { @ApiProperty({ example: 'youtube uri', name: 'youtubeUri' }) @IsUrl() uri: string; @ApiProperty({ example: 'postTitle writed for user' }) @IsString() postTitle: string; @ApiProperty({ example: 'postDescription writed for user' }) @IsString() postDescription: string; } 만약 위와 같은 클래스가 있다면 이를 이용해서 export class uriPostClass { uri: 위의 BasePostClass에 있는 uri 프로퍼티만을 가져와서 이 곳에서 사용하고 싶습니다. } 이와 같이 @ApiProperty 데코레이터를 다시 적어주지 않아도 되고 BasePostClass의 프로퍼티 하나를 바꾸면 이 클래스를 이용해 다른 클래스들에 영향을 주고싶은겁니다. uri라는 이름을 URI로 변경하면 이 다른 클래스에서도 영향을 받아 URI로 변한다거나 하다못해 서버 실행 과정에서 에러라도 발생시킬 수 있도록 하고싶습니다. 프로젝트가 커지다보니 DTO파일을 관리하기도 쉽지 않았어요. db의 컬럼 이름을 하나 바꿔주면 여기저기 dto파일을 찾아다니며 같이 바꿔줘야 했습니다. 좋은 방법이 있다면 알려주실 수 있을까요?
미해결
파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
강사님 안녕하세요 :) 유익한 강의 잘 듣고 있습니다! 학습 중 궁금한 점이 있어서 질문드립니다. 강사님께서 DFS문제 외에도 코드 시작 부분에 이 코드를 작성하실 때가 종종 있는데 혹시 강사님의 사용 기준이 있는지 궁금합니다. ex) [섹션 8] 회장뽑기(플로이드-와샬) 사용 O vs 위상정렬(그래프 정렬) 사용 X
해결됨
실전! 스프링 데이터 JPA
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 안녕하세요 영한님. QueryDsl과 @EntityGraph 사용 기준에 대해 궁금한 부분이 생겨서 질문 남깁니다. fetchJoin을 할 때, 여러가지 방법이 있겠지만 QueryDsl과 @EntityGraph이 가장 편리한 방법이라고 생각합니다. 저의 경우엔 @EntityGraph가 가독성이 더 좋다고 느껴서 간단한 조회용 페치조인의 경우에 사용하고, 검색조건이 있는 복잡한 조회의 경우엔 Querydsl을 사용하는데요. 실제로 이 둘을 사용할 때 어떤 것에 우선순위를 두시는지 궁금합니다. 강의 잘 듣고 있습니다. 감사합니다!
미해결
스프링 부트에서 DTO를 만들 때 @setter을 빼고 @Builder로 하는게 좋다고 들었습니다. 근데 책이랑 구글을 찾아보다 보니 두 가지의 방법으로 하는 것을 봤는데 무슨 차이인지 무엇이 더 좋은 방법인지를 모르겠어서 질문드립니다. 생성자 위에 @Builder를 사용하는 방법 @Getter //Getter 생성 public class LombokPerson { private String name; private String grade; private int age; @Builder // 생성자 만든 후 위에 @Build 어노테이션 적용 public LombokPerson(String name, String grade, int age) { this.name = name; this.grade = grade; this.age = age; } 클래스 위에 @Builder를 사용하면서 @Setter도 사용하는 방법 @ToString @Setter @Getter @Builder @NoArgsConstructor @AllArgsConstructor public class UserDTO { private String token; private String userName; private String password; private String id; } 2번째의 방법이 책에서 나온 방법인데 @Setter이 바뀔 수도 있어서 @Builder로 생성자로 받는거로 알고 있는데 여기서는 @Setter과 @Builder을 같이 쓰더라구여. 이거에 대해서 알려주세요 ㅠㅠ
미해결
java11, springboot2.7.1로 프로젝트 진행했던 프로젝트를 열어 실행하니 에러가 발생합니다. 해결하지 못하여 질문드립니다! 발생에러 11:46:16 AM: Executing ':RandomApplication.main()'... > Task :compileJava FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/7.4.1/userguide/command_line_interface.html#sec:command_line_warnings 1 actionable task: 1 executed FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find javax.xml.bind:jsxb-api:. Required by: project : * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 652ms 11:46:16 AM: Execution finished ':RandomApplication.main()'. Execution failed for task ':compileJava'. > Could not resolve all files for configuration ':compileClasspath'. > Could not find javax.xml.bind:jsxb-api:. Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html 시도 java JDK 버전 확인, 빌드 자동 실행 설정 등.. 구글링해서 찾아봤으나 해결하지 못했습니다ㅠㅠ 검색해보면 jaxb -api:. 를 기준으로 나오는데, 제 에러는 jsxb -api 입니다 이 둘의 차이는 무엇인가요?
미해결
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요 선생님 늘 친절하게 답변해주셔서 감사합니다. 19강에서 궁금한 게 있는데 service와 repository를 스프링 빈으로 만들기 전에 왜 jdbctemplate에 의존할 수밖에 없는 건가요?
미해결
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
"/api/v2/simple-orders " 이 url로 호출했을 때, (1) order테이블에서 가져오는 쿼리 1번 => (2개의 데이터) (2) member 쿼리 1번 * 2 (3) delivery 쿼리 1번 * 2 해서 총 5번이 나오는 걸로 알고 있습니다. 근데 현재 로그에서 총 쿼리가 7번이 나가고 있습니다. 코드를 따라쳐보면서 했는데도 왜 다르게 나가는지 원인을 짐작하기가 힘듭니다. 현재 제 쿼리는 (1) order 테이블에서 가져오는 쿼리 1번 (2) member 쿼리 1번 (3) delivery 쿼리 1번 (4) delivery id 조건절로 order 찾는 쿼리 1번 (2)~(4)번 한 번 더 반복 이렇게 해서 총 7번 쿼리가 나가게 됩니다. 쿼리만 보고 어떤 부분때문에 더 나가게 됐는지 짐작할 수 있을까요? 엔티티 간의 연관관계 매핑은 강의를 보면서 했기 때문에 제가 중간에 놓쳤나 생각이 들기도 하네요ㅜ 원인을 짐작하기가 어렵습니다. select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 join member m1_0 on m1_0.member_id=o1_0.member_id fetch first ? rows only 2023-03-23T19:03:54.387+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select m1_0.member_id, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.name from member m1_0 where m1_0.member_id=? 2023-03-23T19:03:54.390+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select d1_0.delivery_id, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.status from delivery d1_0 where d1_0.delivery_id=? 2023-03-23T19:03:54.393+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-03-23T19:03:54.395+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select m1_0.member_id, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.name from member m1_0 where m1_0.member_id=? 2023-03-23T19:03:54.396+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select d1_0.delivery_id, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.status from delivery d1_0 where d1_0.delivery_id=? 2023-03-23T19:03:54.397+09:00 DEBUG 56506 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=?
미해결
탄탄한 백엔드 NestJS, 기초부터 심화까지
안녕하세요 다음 연재 강의 주제는 소셜 인증이라고 강의 노트에 써있으나 저에게 프로젝트3는 이번 강의가 마지막인데 맞나요??
해결됨
자바 ORM 표준 JPA 프로그래밍 - 기본편
강사님 강의를 보고 최근에 프로젝트를 하다 궁금한게 생겨 질문 남기게 되었습니다. Product <-> Category Entity 다대다 매핑을 위해 product(OneToMany) <-> product_category(ManyToOne) <-> category(OneToMany) 위와 같은 테이블로 매핑한 상태이고 join 상속 전략으로 district_category 테이블도 생성 하였습니다. district_category를 쿼리 파라미터로 받고 해당 district_category를 갖고 있는 상품들을 검색하고 페이징을 하는 로직을 짠다고 했을때 두가지 방법이 생각났는데 둘 중 어느게 더 적합한지 모르겠습니다 검색어를 바탕으로 product_category에서 Product를 EntityGraph로 같이 찾은 후에 찾은 ProductCategory.getproduct() 와 같은 방식 SearchService Category category = districtCategoryRepository.findByDistrictEnum(districtEnum) .orElseThrow(() -> new ProductException(ProductExceptionType.CATEGORY_NOT_FOUND)); return new ProductCategoryToProductPage(productCategoryRepository.findAllByCategory(pageable, category)); ProductCategoryRepository @EntityGraph(attributePaths = "product") Page<ProductCategory> findAllByCategory(Pageable pageable, Category category); ProductCategoryToProduct public ProductCategoryToProductPage(Page<ProductCategory> page) { this.content.addAll(page.getContent().stream() .map(ProductCategory::getProduct) .map(ProductListGetResponseDTO::new) .collect(toList())); this.totalPages = page.getTotalPages(); this.totalElements = page.getTotalElements(); this.pageNumber = page.getNumber() + 1; this.size = page.getSize(); } 발생 쿼리문 select districtca0_.category_id as category2_1_, districtca0_1_.parent_id as parent_i3_1_, districtca0_.district_enum as district1_2_ from district_category districtca0_ inner join category districtca0_1_ on districtca0_.category_id=districtca0_1_.category_id where districtca0_.district_enum=? select productcat0_.product_category_id as product_1_8_0_, product1_.product_id as product_1_7_1_, productcat0_.category_id as category2_8_0_, productcat0_.product_id as product_3_8_0_, product1_.created_date as created_2_7_1_, product1_.content_detail as content_3_7_1_, product1_.product_content as product_4_7_1_, product1_.product_name as product_5_7_1_, product1_.product_price as product_6_7_1_, product1_.product_status as product_7_7_1_, product1_.product_thumbnail as product_8_7_1_ from product_category productcat0_ left outer join product product1_ on productcat0_.product_id=product1_.product_id where productcat0_.category_id=? limit ? select count(productcat0_.product_category_id) as col_0_0_ from product_category productcat0_ where productcat0_.category_id=? 검색어를 바탕으로 product에서 직접 찾기 (데이터 뻥튀기의 문제는 쿼리dsl 이용 productId로 groupBy로 해결) 글 쓰고 생각해보니 A카테고리는 B라는 상품 안에서는 하나밖에 있을 수가 없으니 굳이 groupBy를 안써도 될거 같네요 SearchService Category category = districtCategoryRepository.findByDistrictEnum(districtEnum) .orElseThrow(() -> new ProductException(ProductExceptionType.CATEGORY_NOT_FOUND)); return productRepository.findAllByCategory(pageable, category); ProductRepository @Override public Page<Product> findAllByCategory(Pageable pageable, Category category) { List<Product> content = queryFactory.selectFrom(product) .join(product.productCategories, productCategory) .where(productCategory.category.categoryId.eq(category.getCategoryId())) .groupBy(product.productId) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .fetch(); Long total = queryFactory .select(Wildcard.count) .from(product) .join(product.productCategories, productCategory) .where(productCategory.category.categoryId.eq(category.getCategoryId())) .fetchOne(); return new PageImpl<>(content, pageable, total); } 발생 쿼리문 select districtca0_.category_id as category2_1_, districtca0_1_.parent_id as parent_i3_1_, districtca0_.district_enum as district1_2_ from district_category districtca0_ inner join category districtca0_1_ on districtca0_.category_id=districtca0_1_.category_id where districtca0_.district_enum=? select product0_.product_id as product_1_7_, product0_.created_date as created_2_7_, product0_.content_detail as content_3_7_, product0_.product_content as product_4_7_, product0_.product_name as product_5_7_, product0_.product_price as product_6_7_, product0_.product_status as product_7_7_, product0_.product_thumbnail as product_8_7_ from product product0_ inner join product_category productcat1_ on product0_.product_id=productcat1_.product_id where productcat1_.category_id=? group by product0_.product_id limit ? select count(*) as col_0_0_ from product product0_ inner join product_category productcat1_ on product0_.product_id=productcat1_.product_id where productcat1_.category_id=?
해결됨
실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 안녕하세요 영한님, 강의 잘 듣고 있습니다! 강의에서 JPA가 생성해준 테이블을 그대로 쓰면 안되고, JPA가 쓴 DDL을 다듬어서 쓴다고 하셨는데 생각해보니 저는 토이프로젝트에서 항상 JPA가 만들어주는 그대로 썼던 것 같습니다. 그렇다면 지금 예제에서는 어떤 점을 보완하는게 필요할까요? 감사합니다.
미해결
탄탄한 백엔드 NestJS, 기초부터 심화까지
prettier 관련 질문도 드려도 되는지 모르겠지만 일단 강의에서 나와서 질문드립니다! :) 프리티어 세팅을 하고 작업을 하다가 const test = { a: "test", b: "test2", }; 위와 같은 코드를 써봤는데요. 이 때, 제가 원하는건 a속성과 b속성의 간격이 없는 즉, 의미없는 빈 줄이 없도록 하는 것입니다. 하지만, 이걸 prettier로 자동으로 하는 속성 값을 인터넷으로 찾아봐도(사실 검색할 단어를 잘 못찾은 것 같습니다) 없어서요.. 질문에 올립니다! 감사합니다!
미해결
Nuxt.js 시작하기
처음에 메인페이지를 들어갔을 때에는 배열에 담겨 response가 잘 뜨는데, 새로고침만 하면 이런 에러 화면이 뜨면서 500 error가 발생했다는 콘솔창이 뜹니다. 왜 그런지 알 수 있을까요 ㅠㅠ?
미해결
스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
강의영상에서는 MemberService가 제대로 import 되고 MemberService의 메서드도 불이 잘들어가있는데 왜 import가 안되는지 모르겠습니다. 앱실행하면 구동은 잘됩니다
해결됨
직장인에게 꼭 필요한 파이썬-아래아한글 자동화 레시피
GetText 사용법이 감이 잘 안오네요 while과 state없이 GetText()를 실행하면 텍스트 출력이 안되네요.. 파이썬에서 정확한 문법 정의가 어떻게 되는지요?
해결됨
한국인이 좋아하는 속도로 때려넣는 파이썬
문서 정리 자동화 소프트웨어 만들기 압축 파일에 직원 정보라는 파일이 들어있지 않네요 ㅠ
해결됨
나도코딩의 자바 기본편 - 풀코스 (20시간)
안녕하세요 나도코딩 선생님...ㅎ 몇 주전에 나도코딩 자바편 강의를 완강하고 다시 2회차로 강의를 듣는 중입니다...ㅎ 추상 클래스 (abstract class)와 인터페이스(interface) 관련 강의를 들으면서 각각의 특징들 및 차이점들에 대해서 다시 조금씩 알아가고 있는데... (예를 들면, 추상클래스는 abstract 키워드를 가지고, abstract메소드를 가지고 있어서 객체를 생성할 수 없는 반면, 인터페이스(interface)는 보통 -able 키워드, 변수 X, 생성자 X, 오로지 메소드만 있다 등) 이 둘, 그러니까 추상 클래스 (abstract class)와 인터페이스(interface)는 '어느 때 (또는 어느 시점)'에 활용하는게 가장 적절한지 디테일하게 알 수 없을까요? 항상 좋은 강의와 답변 감사합니다...ㅎ
미해결
Java/Spring 주니어 개발자를 위한 오답노트
안녕하세요! verify : 과정 validate : 최종 결과 check : 확인 is : 존재 여부 이렇게 생각하는데 다른 분들 의견 및 강사분 의견을 듣고싶습니다!
미해결
자바 ORM 표준 JPA 프로그래밍 - 기본편
기본적인 개념같아서 구글링도 해봤는데 object 와 object[] 배열간의 형변환에 대한 내용이 안보여서 질문드립니다. 다름이 아니라 Object o = resultList.get(); Object[] result = (Object[])0; 에서 왜 Object 타입에서 Object[] 타입으로 형변환을 해야하는지, 그냥 o[0], o[1] ... 로 쓰면 왜 컴파일 오류가 나는지 궁금합니다. Object 타입에서 어떻게 Object[] 타입으로 형변환이 가능한지 궁금합니다. Obect[] 배열은 Object가 여러개 포함된 배열 아닌가요?.. 아니면 Object 타입이 Object[] 타입까지도 포함한 포괄적인 개념이라 위처럼 형변환이 가능한 건가요? 기본적인 내용같은데 개념이 잘 이해가 안가서 질문드립니다 ㅠㅠ