src/app/(with-searchbar)/search/page.tsx Type error: Type 'Props' does not satisfy the constraint 'PageProps'. Types of property 'searchParams' are incompatible. Type '{ q?: string | undefined; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag] vercel 명령어 사용시 build문제에서 에러가 생겼다고 하면서 위와 같은 타입 에러가 나오네요 ㅠ 선생님께서 제공해주신 github에서 내용을 가져와 적용해보았으나 같은 에러가 나오게되어 질문드립니다.
강의 잘 듣고있습니다. 이번 강의에서 front와 API를 연결하는 작업 도중, 계속 마지막에 토큰까지는 잘 받아오지만 웹소켓을 못 만드는 문제가 발생했습니다. 문제가 무엇일까 계속 고민해보다가 이 강의 가장 처음에 강사님이 진행했던 =을 붙이는 작업이 떠올라 그 =을 다시 지워줬습니다. 그런데 해결이 됐습니다. 제 키에는 =가 마지막에 없더라구요... =가 있는 경우와 없는 경우가 존재하나봅니다. =의 차이가 혹시 무엇인지 알 수 있을까요? 그냥 암호의 일부분일까요?
https://drive.google.com/file/d/1PBHzDQJ0Odvh2KWMa_BTOu3PZqHrMJkj/view?usp=drive_link MemberRepositoryTest를 실행하면 이렇게 됩니다. junit5로 하고 있는데 이런식으로 오류가 발생합니다. JPA와 DB 설정, 동작확인 13분경까지 들었습니다. JpashopApplication를 실행해도 오류가 발생하기 시작했습니다.
제가 이해한 구조는 아래와 같습니다. Request -> API -> Service -> Entity Redis에서 캐시 조회 실패하면 redis에서 몽고 db collection 관련 함수를 직접 조회 하는 게 아니라 서비스로 돌아가서 서비스단에서 몽고 db collection 관련 함수를 호출하는게 맞지 않나요? 아니면 주신 코드 처럼 Entity 단에서는 서로를 호출하면서 작동하는게 맞나요?
안녕하세요. 문제점 해결하기 강의에서 실습을 잘 진행했습니다. 실험을 하며 결과를 관측하던 중, @NoArgsConstructor(access = AccessLevel.PROTECTED) @RequiredArgsConstructor @Entity public class Coupon { @Id @GeneratedValue private Long id; } 위와 같이 @GeneratedValue를 적용하면 로그패턴도 달라지고 성능이 급격하게 나빠지더라고요 @Id @GeneratedValue(strategy = GenerationType.IDENTITY) 로 지정하면 실습이 잘 진행됩니다. 왜 이런차이가 발생하는지 알 수 있을까요? strategy를 선택하지 않으면 AUTO이며 이는 mysql에서 IDENTITY를 선택한 것과 같게 나와야하는데 예상과 달라 질문드려봅니다.
상세페이지 href속성을 찾아 기존페이지 url?상세페이지 url을 적용하여 실습을 성공해 오다가 난관에 부딪혔습니다. html속성값을 보니 아래와 같이 되어 있고 url에 붙이거나 해도 페이지가 로드 되지 않아 어려움을 겪고 있습니다. <a href="Javascript:view_content('869');">처리 일정 문의 드립니다.</a> 위와같은 href가 나타날때는 어떻게 상세페이지로 이동해야 하는지 궁금하고 이럴때 혹시 우회할 수 있는 대안이 있다면 알고 싶어요
junt4로 gradle에서 설정하려고 하면 오류가 발생해서 juit5로 하는 중입니다. MemberRepositoryTest를 junit5버전으로 고쳐서 아래의 코드로 실행했는데 오류가 나고 있습니다 import jpabook.jpashop.Member; import jpabook.jpashop.MemberRepository; //import jpabook.jpashop.domain.Member; //import jpabook.jpashop.repository.MemberRepository; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.transaction.annotation.Transactional; @ExtendWith(SpringExtension.class) // JUnit 5 방식 @SpringBootTest public class MemberRepositoryTest { @Autowired MemberRepository memberRepository; @Test @Transactional @Rollback(false) public void testMember() { Member member = new Member(); member.setUsername("memberA"); Long savedId = memberRepository.save (member); Member findMember = memberRepository.find(savedId); Assertions.assertThat(findMember.getId()).isEqualTo(member.getId()); Assertions.assertThat(findMember.getUsername()).isEqualTo(member.getUsername()); Assertions.assertThat(findMember).isEqualTo(member); // JPA 엔티티 동일성 보장 } } 밑에는 오류입니다. Unable to find a @SpringBootConfiguration by searching packages upwards from the test. You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test supported mechanisms to explicitly declare the configuration classes to load. Classes annotated with @TestConfiguration are not considered. java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration by searching packages upwards from the test. You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test supported mechanisms to explicitly declare the configuration classes to load. Classes annotated with @TestConfiguration are not considered. at org.springframework.util.Assert.state(Assert.java:79) 1. @SpringBootTest(classes=...) 로 명시적으로 설정 클래스 지정 2. @SpringBootApplication 이 있는 클래스의 위치 확인 3. @ContextConfiguration 을 사용해서 명시적으로 설정 클래스 지정 이세가지를 시도해도 안되고 있습니다. 아니면 juni4룰 사용해야만 할까요? build.gradle에 JUnit4 추가 testImplementation("org.junit.vintage:junit-vintage-engine") { exclude group: "org.hamcrest", module: "hamcrest-core" } 를 하면 Build file 'C:\Users\Peter\Desktop\study\jpashop\build.gradle' line: 45 A problem occurred evaluating root project 'jpashop'. > Could not find method testImplementation() for arguments [org.junit.vintage:junit-vintage-engine, build_55eer8btj8rd1l6xp0yqapa0y$_run_closure6@6e20627f] on root project 'jpashop' of type org.gradle.api.Project. 라고 나옵니다.
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2025-02-13T00:15:43.156+09:00 ERROR 7780 --- [ main] o.s.boot.SpringApplication : Application run failed Error creating bean with name 'entityManagerFactory' 이런 오류가 뜹니다 쿼리가 안 만들어져요 이오류 때문에 ㅜ
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? [질문 내용] PPT 양방향 매핑에서 테이블연관관계를 나타낼때 TEAM의 PK가 MEMBER의 FK 로 존재한다면 실선이 아닌 점선으로 표현되어야 하는 것 아닌가요 ? MEMBER의 경우 TEAM_ID가 PK가 아니니까 null을 허용할 수 있으니 팀이 없는 경우가 존재할 테니까 멤버가 팀을 가지고 있는 것은 선택적인 관계로 점선으로 표현해야하는 것이 아닌가 싶습니다
19:49:22.386 [main] INFO org.springframework.test.context.support .AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.mysite.sbb.SbbApplicationTests]: SbbApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration. console에 위와 같은 문구가 나오고 아래로 실행 문구가 뜨지 않습니다.
안녕하세요. sorting 파트의 문제 4번 심사위원 문제의 시간복잡도 질문입니다. 정답 코드에서 score를 순회하며 getAve 함수를 호출하면서 이중 for문이 실행됩니다. score의 최대 길이가 30만이고, k가 최대 10만이므로 시간 복잡도는 O(nk)입니다. 최악의 경우 30만 × 10만 = 300억 번 연산이 발생하는데, 이는 1~2초의 제한 시간 내에 절대 수행될 수 없으므로 시간 초과가 발생하는 코드가 맞나요? 또한 제 풀이도 평가 부탁드립니다. 누적합 배열을 사용해서 풀어봤습니다. 이러면 시간복잡도가 O(nlogn)이 나와서, 최악의 경우라도 O(90만)이라고 계산했는데, 맞을까요? import java.util.*; class Solution { public int solution(int[] score, int k){ int answer = 0, n = score.length; Arrays.sort(score); //pre: 누적합 배열 int[] pre = new int[n]; pre[0] = score[0]; //누적합 구하기 for(int i = 1; i < n; i++){ pre[i] = pre[i-1] + score[i]; } //score 순회하면서, 조건 만족하면 누적합 배열로 평균 구하기 for(int i = 0; i <= n - k; i++){ if(score[i + k - 1] - score[i] <= 10){ int tmp; if(i == 0){ tmp = pre[i + k - 1]; }else{ tmp = pre[i + k - 1] - pre[i - 1]; } tmp /= k; //평균 answer = tmp; break; } } return answer; } public static void main(String[] args){ Solution T = new Solution(); System.out.println(T.solution(new int[]{99, 97, 80, 91, 85, 95, 92}, 3)); System.out.println(T.solution(new int[]{92, 90, 77, 91, 70, 83, 89, 76, 95, 92}, 4)); System.out.println(T.solution(new int[]{77, 88, 78, 80, 78, 99, 98, 92, 93, 89}, 5)); System.out.println(T.solution(new int[]{88, 99, 91, 89, 90, 72, 75, 94, 95, 100}, 5)); } }
pgAdmin의 Post 데이터를 전부 삭제한 후 다시 기록하고 싶어서 Post 내부 데이터를 전부 선택/삭제(휴지통 버튼 클릭)한 후 PSQL Tools에 COMMIT을 입력하라고 정보가 있어서 실행에 옮겼는데 갑자기 9090페이지가 아예 안돌아가네요(로그인 안됨, API문서 접근불가 등등) ㅠㅠ 어떻게 방법없을까요