묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
setter없이 생성메서드 생성하는 방법
안녕하세요 강사님, 서포터즈님들 JPA 실전까지 모두 완강하고 개인 프로젝트를 진행 중입니다. 강사님께서 강의 때 setter의 사용을 지양하라고 하셨는데, 생성메서드 생성 시 setter를 사용하지 않고 제가 짠 코드대로 해도 문제가 없을까요? --------- 생각해보니까 이것도 setter를 사용한거나 다름 없는 것 같은데, 생성메서드 생성할 때 setter없이 하는 방법이 있나요? @Id @GeneratedValue @Column(name = "fileId") private Long id; private String fileNm; private String path; private Long size; private String extension; private String fileType; @JoinColumn(name = "restaurantId") @OneToOne(fetch = FetchType.LAZY) private Restaurant restaurant; @JoinColumn(name = "menuId") @OneToOne(fetch = FetchType.LAZY) private Menu menu; //생성메서드 public static FileEntity createFile(FileEntity fileInfo) { FileEntity file = new FileEntity(); file.setFile(fileInfo.getFileNm(), fileInfo.getPath(), fileInfo.getSize(), fileInfo.getExtension(), fileInfo.getFileType()); return file; } public void setFile(String fileNm, String path, Long size, String extension, String fileType) { this.fileNm = fileNm; this.path = path; this.size = size; this.extension = extension; this.fileType = fileType; }
-
미해결반응형 웹사이트 포트폴리오(Architecture Agency)
home 화면에서 .home-heading 에서 스페이스 문제
안녕하세요. 홈화면에서 .home-heading 밑에 3개의 span 으로 묶인 텍스트들이 있는데요. 그 텍스트들 중에 스페이스가 들어가면 애니매이션이 매끄럽게 되지 않습니다. 예를 들어서 <span>Creative & Design</span> <== 여기에 & Design을 추가 했습니다. <span>Architecture</span> <span>Specialists</span> 이렇게 넣어 보시면 이상한 현상이 발생합니다. 영문이 아닌 한글을 넣어도 그런 현상이 일어 납니다.해결 방법이 없을까요?
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
타임리프 문법으로 경로 수정하는데 적용이 안되는것 같습니다
상품목록-타임리프 강의에서 <tr th:each="item : ${items}"> <td><a href="item.html" th:href="@{/basic/items/{itemId} (itemId=${item.id})}" th:text="${item.id}">회원id</a></td> <td><a href="item.html" th:href="@{|/basic/items/${item.id}|}" th:text="${item.itemName}">상품명</a></td> <td th:text="${item.price}">10000</td> <td th:text="${item.quantity}">10</td></tr>이코드를 따라쳤는데도 안되서 강의 자료에있는걸 복사 붙여넣기했는데도 경로가 수정이 안됩니다.. 왜그럴까요 ??ㅠㅜ
-
미해결입문자를 위한, HTML&CSS 웹 개발 입문
강의교안 문서 중에 HTML 기본 태그 내용이 안보여서요.
안녕하세요. 강의 듣고 교안 문서를 보려구 했는데요. 주소를 잘 몰라서요. HTML&CSS 입문 (gymcoding.co) 로 접근은 했는데 HTML 기본태그 링크 눌르면 HTML 요소 조작하기로 연결되는 것 같아서요. 한번 확인 부탁드립니다. 감사합니다.
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
깃헙 권한 요청드립니다.
- 인프런 아이디 : ekzm3825 - 인프런 이메일 : ekzm3825@gmail.com - 깃헙 아이디 : deepmining3825@gmail.com - 깃헙 Username deepmining3825
-
미해결고수가 되는 파이썬 : 동시성과 병렬성 문법 배우기 Feat. 멀티스레딩 vs 멀티프로세싱 (Inflearn Original)
I/O Bound(1) - Synchronous 질문입니다
1. 해당 수업에서 I/O Bound Sync 예제에 대해서 설명을 해주셨는데 그러면 여태까지 배웠던 쓰레드들(싱글쓰레드, 동기화, 생산자 소비자 등)와 프로세스들(멀티프로세스, 메모리공유, 파이프, 큐 등) 을 활용해서 CPU Bound, I/O Bound 들을 구현하는 것인가요? 2. 여태까지 배웠던 쓰레드들과 프로세스들 구현은 CPU Bound라고 볼 수 있는지 궁금합니다 3. request를 통해서 서버에서 가져오는 것이니까 I/O bound를 구현했다고 볼 수 있는 것인가요? 4.실시하려고 하는 작업이 I/O Bound, CPU Bound 인지 구분하는 방법이 따로 있는지 궁금합니다
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
passport로 로그인 에러 시 payload 전달 방법
강사님, 안녕하세요. 혼자서 해보려다가 도저히 모르겠어서 질문 드립니다. 로그인 에러 시 각각 상황에 맞는 logInError를 안내하고 싶어서 제작 중인데, 회원가입할때도 다른 작업할때도 에러나면 payload 값이 잘 나오던데, 로그인 할때만 에러나면 Payload 값이 undefined 로 나오네요. 회원가입한적 없는 아이디일때 "존재하지 않는 이메일입니다" 아이디는 있으나 비밀번호가 틀렸을때 "비밀번호가 틀렸습니다" /back/routes/user.js 에서 //SignUp router.post('/', isNotLoggedIn, async (req, res, next) => { try { *** if (exUser) { return res.status(403).json('이미 가입된 아이디입니다.'); } *** } catch (error) { console.error(error); next(error); } }); 이렇게 json 형태로 에러 메시지를 적어주면 front로 전달된다고 배웠고, 회원가입이나 다른 호출은 다 잘 출력됩니다. 그런데 login 쪽만 payload(logInError)가 undefined로 나옵니다. (개발자도구 네트워크에서는 메시지가 잘 찍힙니다.) router.post('/login', isNotLoggedIn, (req, res, next) => { passport.authenticate('local', (err, user, info) => { *** if (info) { return res.status(401).json(info.reason); } *** })(req, res, next); }); /back/passport/local.js *** module.exports = () => { passport.use( new LocalStrategy( *** async (userid, password, done) => { try { *** if (!user) { return done(null, false, { reason: '존재하지 않는 이메일입니다!' }); } *** return done(null, false, { reason: '비밀번호가 틀렸습니다.' }); } catch (error) { *** } } ) ); }; //회원가입 페이지 /front/reducers/user.js //회원가입 페이지 //로그인 페이지 회원가입과 다르게 로그인은 passport가 쓰여서인듯 한데, 에러 났을때 payload 값을 가져오게 할 방법이 있을까요?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
AOP 시간 출력
2022-08-03 16:59:23.367 INFO 16631 --- [ main] b.basicspring.BasicSpringApplication : Starting BasicSpringApplication using Java 11.0.16 on yundabinui-MacBookPro.local with PID 16631 (/Users/yundabin/Spring/basic-spring/out/production/classes started by yundabin in /Users/yundabin/Spring/basic-spring)2022-08-03 16:59:23.371 INFO 16631 --- [ main] b.basicspring.BasicSpringApplication : No active profile set, falling back to 1 default profile: "default"2022-08-03 16:59:23.993 INFO 16631 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.2022-08-03 16:59:24.040 INFO 16631 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 38 ms. Found 1 JPA repository interfaces.2022-08-03 16:59:24.529 INFO 16631 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)2022-08-03 16:59:24.541 INFO 16631 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]2022-08-03 16:59:24.541 INFO 16631 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65]2022-08-03 16:59:24.639 INFO 16631 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2022-08-03 16:59:24.639 INFO 16631 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1205 ms2022-08-03 16:59:24.805 INFO 16631 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]2022-08-03 16:59:24.848 INFO 16631 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.10.Final2022-08-03 16:59:25.002 INFO 16631 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}2022-08-03 16:59:25.093 INFO 16631 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...2022-08-03 16:59:25.176 INFO 16631 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.2022-08-03 16:59:25.205 INFO 16631 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect2022-08-03 16:59:25.673 INFO 16631 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]2022-08-03 16:59:25.682 INFO 16631 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'2022-08-03 16:59:26.077 WARN 16631 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning2022-08-03 16:59:26.219 INFO 16631 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]2022-08-03 16:59:26.418 INFO 16631 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''2022-08-03 16:59:26.427 INFO 16631 --- [ main] b.basicspring.BasicSpringApplication : Started BasicSpringApplication in 3.44 seconds (JVM running for 3.815)2022-08-03 16:59:30.990 INFO 16631 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'2022-08-03 16:59:30.991 INFO 16631 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'2022-08-03 16:59:30.992 INFO 16631 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 msHibernate: select member0_.id as id1_0_, member0_.name as name2_0_ from member member0_ where member0_.name=?Hibernate: insert into member (id, name) values (default, ?)Hibernate: select member0_.id as id1_0_, member0_.name as name2_0_ from member member0_Hibernate: select member0_.id as id1_0_, member0_.name as name2_0_ from member member0_ ------------------------------------------------------------- 으로 시간 결과가 출력이 안되는데 혹시 이유가 무엇일까요? 제 파일이 hello.hellospring이 아니라 basic.basicspring이라서 @Around("execution(* basic.basicspring..*(..))") 으로 적어두었는데 이것 때문일까요..?
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
스프링부트 db 기본 옵션
안녕하세요 스프링부트의 기본 옵션에 대해 궁금한 것이 생겨 질문드립니다. 강의 중에 스프링부트는 application.yml에 별도의 설정이 없다면 db를 메모리 모드로 돌리고, ddl-auto 옵션을 create-drop을 기본으로 한다고 하셨습니다. 이러한 기본 옵션이 test에만 해당 되는 건가요? main과 test 모두에 해당되는 기본 옵션인가요?? 말씀하신 기본 옵션이 모두 test를 실행할 때에 필요한 옵션들이라고 생각돼서 혹시나 test에만 적용되는 기본값인지 궁금합니다!
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
MemberServiceTest코드에서 AfterEach 질문
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. MemberServiceTest에서 memberRepository를 사용하여 afterEach메서드를 통해 초기화 시켜주는데 memberService 안의 memberRepository가 final 하기 때문에 건드리지 못해서 밖에서 memberRepository 오버로딩을 통해 초기화 해주는건가요?? 맞다면 final 키워드가 붙어있는 memberRepository를 밖에서 오버로딩할수 있는건가요? MemberService안에 있는 memberRepository는 private final인데 그 밖에서 선언한 memberRepository를 초기화해주는것으로 어떻게 초기화가 되는거인지 궁금합니다...!!
-
미해결Do it! 자바 프로그래밍 입문 with 은종쌤
메서드와 생성자
메서드와 생성자의 차이가 무엇인가요?
-
미해결[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part2: 게임 수학과 DirectX12
DirectX12 초기화 [ 장치 초기화] 부분
안녕하세요 루키스님 현재 강의 내용을 전부 잘 따라가다 장치초기화 부분에서 ComPtr을 입력하는 순간부터 열수 없는 template라는 에러가 뜨게되는데어떻게 해야할까요 루키스님이 주신 예제 파일들과 코드를 보면서 다른 부분들을 찾아보려고 해도 보이질않아 도움 요청드립니다! 중하는 문화를 만들요.
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
stack으로 구현
아래 코드와 같이 stack으로 구현했는데 접근 방식이 잘못된 걸까요? 삽입 정렬이 떠오르지 않아서 이렇게 했습니다 ㅠㅠ import java.io.*;import java.util.*;public class Main {public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));public static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));public static StringTokenizer st;public static void main(String[] args) throws IOException{st = new StringTokenizer(br.readLine()," ");int size = Integer.parseInt(st.nextToken());int num = Integer.parseInt(st.nextToken());st = new StringTokenizer(br.readLine()," ");Stack<Integer> s = new Stack<>();for(int i =0 ;i<num ;i++) {int t = Integer.parseInt(st.nextToken());// 먼저 이미 있는 건지 확인if (s.contains(t)) {// 이미 들어있으면 삭제하고 맨 위에 넣어s.remove(s.indexOf(t));s.push(t);}// 없는 값이 들어왔을 때else {// 일단 추가하고 s.push(t);// 사이즈가 초과됐으면if (s.size() > size) {s.remove(0); // 맨 밑에꺼 삭제해}}}while(!s.isEmpty()){bw.write(s.pop() + " ");}bw.flush();br.close();}}
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part1: C# 기초 프로그래밍 입문
abstract 관련 질문입니다.
추상설명하시면서 인터페이스로 다중상속을 하신다고 하셨는데 interface IFlyable(){ void Fly() } 하셨는데 interface IFlyable(){ abstract void Fly() } 혹시 이렇게하면 차이가 있을까요? 아니면 인터페이스는 그자체가 무조건 자식도 구현해야 하기때문에 차이가 없나요?
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
라디오 버튼 이벤트 막기
안녕하세요! 오랜만에 문의를 드립니다. 강의와 관련이 없을 수 있으나… 질문을 할 곳이 없어서요 ㅜㅜ <input type=“radio”>에 readonly 속성을 주었습니다. 그런데 클릭이 가능합니다. 검색을 많이 해봤는데, 라디오 readonly 는 원래 그렇다는 말만 나오고.. 해결 방법으로 return false 를 주라고 합니다. return false를 추가해도 이벤트가 막히지 않습니다. 혹시 몰라서 event.target.preventDefault() 를 추가해보았는데 Property 'preventDefault' does not exist on type '{ target: HTMLInputElement; }'. 해당 속성을 가지고 있지 않는다는 에러가 뜹니다. function onClick (event : { target: HTMLInputElement }) { }) 현재 저의 소스인데요. ts를 쓰고 있습니다. 참고 부탁 드립니다. disabled를 쓰는 게 맞을까요? disabled는 값을 넘기지 않는다고 하여, readonly가 맞다고 생각하는데요..
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
지수만큼 곱해지지 않는 것 같습니다.
1-N 문제 질문드립니다.강의하신 코드를 에디터에서 돌려봤는데요.b가 홀수 인 경우 b만큼 곱해지지 않습니다. 만약 a = 2, b = 3이면 2^2의 나머지 값이 나오고a = 2, b = 5이면 2^3의 나머지 값이 나오고a = 2, b = 10이면 2^6의 나머지 값이 나옵니다. 지수만큼 곱해지지 않아도 답이 될 수 있는 이유가 있을까요?
-
미해결실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
오류
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2022-08-03 16:23:18.841 ERROR 14112 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : ***************************APPLICATION FAILED TO START*************************** Description: The dependencies of some of the beans in the application context form a cycle: ┌─────┐| initDb defined in file [C:\Users\pkl46\OneDrive\Desktop\spring\jpashop\jpashop\out\production\classes\jpabook\jpashop\InitDb.class]↑ ↓| jpabook.jpashop.InitDb$InitService└─────┘ Action: Despite circular references being allowed, the dependency cycle between beans could not be broken. Update your application to remove the dependency cycle. Process finished with exit code 1 이런 오류가 뜨면 어느 부분을 놓친 걸까요? ㅜㅜ
-
해결됨파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트
project 폴더 설정 관련 질문
안녕하세요, askcompany 프로젝트 폴더 설정하는 부분에서 몇가지 질문이 있습니다. 1. DEBUG 모드일때만 프로젝트 폴더의 urls.py에 media 관련 url을 추가해주는 이유가 있을까요? 해당 url은 어떤 역할을 하게 되는 것인가요? 2. 프로젝트 폴더의 urls.py에서 사용한 from django.conf import settings과 django github의 django.conf.global_settings.py의 차이가 궁금합니다. 3. 2번의 settings와 프로젝트 폴더에 자동으로 생성된 settings.py의 차이가 궁금합니다. 4. settings를 개발과 운영으로 나눴는데 그렇다면 settings/prod.py에 DEBUG=False와 같은 설정을 바꿔야 하는게 아닌지 궁금합니다. 감사합니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
관리자 도메인이 존재 할때의 서비스 구조
안녕하세요. 강의 잘 봤습니다. 혹시 관리자 도메인이 존재할 시에는 어떻게 구조가 나눠지는지 참고 할 사례가 있을가요? 일반적으로 클라이언트에서 구매가 이루어진다면 상품에 대한 소비(클라이언트)와 구성을 담당하는 도메인(관리자 도메인)이 있을건대 이럴때는 어떤게 분리 되는지 궁금합니다. 클라이언트에서 접근하는 상품 영역과 관리자에서 접근하는 상품 영역은 하나의 상품 서비스 서버로 구성하는지, 분리해서 별도의 서비스 봐야되는지 궁금합니다. 실제 서비스에 녹이고 있는대 이부분을 적용하는 게 가장 어렵내요. 소비에서의 서비스 트래픽과 구성에서의 서비스 트래픽이 다르다 보니 서버의 구성을 잡는게 고민되내요 혹시 참고할 만한 사례가 있다면 부탁 드립니다.
-
미해결
Travis Scott Sneakers thousands of items
It's a new year and old notions of gendered fashion are firmly in the past. The proof is not only on the runways but in the outfits worn by guests outside. Debuting with a six-piece collection of fashion-forward, functional essentials, these styles can be used for layering or standalone wardrobing. The seamless fabrics are made in a factory that specializes in knitting processes which minimize waste, further demonstrating the brand's sustainable use of resources. The season was not without a little flair. Moon boots also made a handful of appearances, coupled with plaid midi skirts, fashionable fleeces, and acid wash jeans. Because there are millions of choices on Amazon and going through the results for even a single inquiry can be exhausting, we went through tens of Travis Scott Sneakers thousands of items and put together a definitive list of the best gifts you can shop this year with Prime. Our non-negotiable criteria? Items had to be unique, high-quality, practical, and chic, because nobody has time for anything else these days. The good news is that getting out of a winter style rut is easier than you may think. Moon boots also made a handful of appearances, coupled with plaid midi skirts, fashionable fleeces, and acid wash jeans. Light blue lug soled Chelsea boots were used as a pop of color to brighten up looks made up of grey tailoring, and ocean blue rubber ankle boots contrasted pastel trousers. Moon boots also made a handful of appearances, coupled with plaid midi skirts, fashionable fleeces, and acid wash jeans. Unbalanced III is centered around New Balance's 1080v11 model, a Travis Scott Shoes shoe highly favored among marathon runners for its comfort and support. Across the collection is a larger theme of asymmetry that poses the concept of running as a measure of personal growth, rather than a simple start-to-finish achievement. Now he's putting those materials to work on those party pants and a matching slip dress, as well as on contrast linings that elevate his tailoring and as fabric covered stone appliques on an evening dress. It is no surprise that designers consistently find ways of incorporating the heritage pattern into their spring and summer offerings. Let's be honest, Coachella is all about fashion - risk-taking fashion that is. Whether it's trending, outdated or never-before-seen (like this top made from Instax photographs), festivalgoers are slightly more blase toward Travis Scott x Nike Shoes the rules. In a palette of off-white neutrals paired with charming accessories, it's a look that anyone, man or woman, would be happy to sport this season. Light blue lug soled Chelsea boots were used as a pop of color to brighten up looks made up of grey tailoring, and ocean blue rubber ankle boots contrasted pastel trousers. The front pockets, once visible, were hidden on the side seam. During couture week in the '90s, the grand reveals of Atelier brides were always a highlight. Willow recognizes that systemic change is needed. That doesn't mean having to simplify it to the point of reducing its impact.