code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,121 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { withRouter } from 'react-router';
+import './Login.scss';
+
+const REGEXP = {
+ emailRegExp:
+ /[a-zA-Z0-9.-_+!]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]{2,}(?:.[a-zA-Z0-9]{2,3})?/,
+ passwordRegExp: /[a-zA-Z0-9]{5,100}/,
+};
+
+cl... | JavaScript | validateInputData 를 호출하고 계시지만 이 함수는 실행되기만 하고 리턴값을 어디에도 활용하지 않고 있는 것 같습니다!
실질적으로 어떤 의미도 없는 코드같습니다! |
@@ -0,0 +1,121 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { withRouter } from 'react-router';
+import './Login.scss';
+
+const REGEXP = {
+ emailRegExp:
+ /[a-zA-Z0-9.-_+!]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]{2,}(?:.[a-zA-Z0-9]{2,3})?/,
+ passwordRegExp: /[a-zA-Z0-9]{5,100}/,
+};
+
+cl... | JavaScript | `const {name, value} = e.target;` 으로 구조분해해서 사용하시면 좀 더 간결하겠네요! |
@@ -0,0 +1,121 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { withRouter } from 'react-router';
+import './Login.scss';
+
+const REGEXP = {
+ emailRegExp:
+ /[a-zA-Z0-9.-_+!]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]{2,}(?:.[a-zA-Z0-9]{2,3})?/,
+ passwordRegExp: /[a-zA-Z0-9]{5,100}/,
+};
+
+cl... | JavaScript | 👍
state값도 구조분해해서 사용하면 좀 더 간결해보일 것 같습니다! |
@@ -0,0 +1,121 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { withRouter } from 'react-router';
+import './Login.scss';
+
+const REGEXP = {
+ emailRegExp:
+ /[a-zA-Z0-9.-_+!]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]{2,}(?:.[a-zA-Z0-9]{2,3})?/,
+ passwordRegExp: /[a-zA-Z0-9]{5,100}/,
+};
+
+cl... | JavaScript | 건우님이 리뷰 잘 남겨주셨네요 확인하고 반영해보세요!👍 |
@@ -0,0 +1,121 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { withRouter } from 'react-router';
+import './Login.scss';
+
+const REGEXP = {
+ emailRegExp:
+ /[a-zA-Z0-9.-_+!]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]{2,}(?:.[a-zA-Z0-9]{2,3})?/,
+ passwordRegExp: /[a-zA-Z0-9]{5,100}/,
+};
+
+cl... | JavaScript | 애초에 boolean을 리턴하는 함수이기 때문에 not 연산자를 활용해서
```suggestion
const isDisabled = !this.validateInputData(userId, userPw)
```
button tag에서 한번만 사용되는 값이라면 따로 변수선언 할당과정 거칠 필요 없이 버튼 태그 내에 바로 적어줘도 될 것 같습니다! |
@@ -0,0 +1,121 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+import { withRouter } from 'react-router';
+import './Login.scss';
+
+const REGEXP = {
+ emailRegExp:
+ /[a-zA-Z0-9.-_+!]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]{2,}(?:.[a-zA-Z0-9]{2,3})?/,
+ passwordRegExp: /[a-zA-Z0-9]{5,100}/,
+};
+
+cl... | JavaScript | ```suggestion
disabled={!this.validateInputData(userId, userPw)}
```
위에 달아드린 코멘트와 이어지는 내용입니다! |
@@ -0,0 +1,156 @@
+@import '../Styles/common.scss';
+
+.entire-container {
+ @include flex-set(row, center, center);
+ width: 100%;
+ height: 100vh;
+ background-color: $background-default-color;
+
+ .entire {
+ width: 350px;
+ background-color: $background-default-color;
+
+ .entire_top {
+ height: ... | Unknown | 컴포넌트 이름으로 nesting 적용해주세요!
이렇게 되면 다른 컴포넌트들의 스타일에도 영향을 미칠 수 있습니다! |
@@ -0,0 +1,156 @@
+@import '../Styles/common.scss';
+
+.entire-container {
+ @include flex-set(row, center, center);
+ width: 100%;
+ height: 100vh;
+ background-color: $background-default-color;
+
+ .entire {
+ width: 350px;
+ background-color: $background-default-color;
+
+ .entire_top {
+ height: ... | Unknown | 공통적으로 적용되어야 하는 속성이라면 common에 넣어주시는 게 맞습니다! |
@@ -0,0 +1,156 @@
+@import '../Styles/common.scss';
+
+.entire-container {
+ @include flex-set(row, center, center);
+ width: 100%;
+ height: 100vh;
+ background-color: $background-default-color;
+
+ .entire {
+ width: 350px;
+ background-color: $background-default-color;
+
+ .entire_top {
+ height: ... | Unknown | mixin 잘 활용해주셨네요! |
@@ -0,0 +1,12 @@
+package develop.baminchan;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SidedishApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(SidedishApplication... | Java | Security 설정이 별도 클래스로 독립하면 조금 더 좋을 것 같네요. |
@@ -0,0 +1,75 @@
+package develop.baminchan.controller;
+
+import develop.baminchan.dto.BanchanDto;
+import develop.baminchan.dto.CategoryDto;
+import develop.baminchan.dto.banchan.BanchanDetailDto;
+import develop.baminchan.entity.Banchan;
+import develop.baminchan.service.BanchanService;
+import org.springframework.h... | Java | `@PathVariable` 안에 path variable name을 설정할 수 있는 필드가 있을 거라 생각합니다.
어떠한 순간에도 자바의 기본적 코딩 컨벤션을 계속 준수해주세요. |
@@ -0,0 +1,24 @@
+package develop.baminchan.controller;
+
+public class Message {
+ public static final int OK = 200;
+ public static final int BAD_REQUEST = 400;
+ public static final int NOT_FOUND = 404;
+ public static final int INTERNAL_SERVER_ERROR = 500;
+
+ private int statusCode;
+ private Obj... | Java | `enum` 으로 관리해보시면 어떨까요? |
@@ -0,0 +1,78 @@
+package develop.baminchan.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import develop.baminchan.entity.Banchan;
+
+import java.util.Set;
+
+import static develop.baminchan.dto.util.StringConvertor.convertToSet;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BanchanDto {
+... | Java | `@JsonProperty` 를 통해 JSON field의 이름 정해주시면 될 것 같아요.
언더스코어는 자바 코드에 없었으면 합니다. |
@@ -0,0 +1,78 @@
+package develop.baminchan.dto;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import develop.baminchan.entity.Banchan;
+
+import java.util.Set;
+
+import static develop.baminchan.dto.util.StringConvertor.convertToSet;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BanchanDto {
+... | Java | `private` 으로 가려놨으므로 모든 필드에 해당하는 파라메터를 다 선언해주셔도 됩니다.
또 그렇게 해야 추후 확장성 측면에서도 좋을 거라 생각합니다.
`Banchan` 을 받아서 하나씩 정보를 꺼내는 책임은 `.of()` 에게 맡기고 생성자에선 단순 값 할당에 집중하면 어떨까요. |
@@ -0,0 +1,45 @@
+package develop.baminchan.dto;
+
+import develop.baminchan.entity.Category;
+import org.springframework.data.annotation.Id;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CategoryDto {
+ @Id
+ private int id;
+
+ private String category_id;
+ private String name;
+
... | Java | DTO인데 `@Id`.... 괜찮을까요? |
@@ -0,0 +1,20 @@
+package develop.baminchan.dto.util;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public class StringConvertor {
+ private StringConvertor() {
+ }
+
+ public static Set<String> convertToSet(String column) {
+ if (column == null) {
+ return ... | Java | [이 링크](https://docs.spring.io/spring-data/jdbc/docs/current/reference/html/#jdbc.custom-converters) 를 참고해주시고 표준 스펙에 맞는 클래스로 전환을 부탁드릴게요. |
@@ -0,0 +1,35 @@
+package develop.baminchan.entity;
+
+import org.springframework.data.annotation.Id;
+
+public class Order {
+ @Id
+ private Long id;
+
+ private String client_id;
+ private String detail_hash;
+ private int quantity;
+
+ public Order(Long id, String client_id, String detail_hash, int... | Java | 굳이 약어를 사용하실 필요는 없어 보이기는 합니다.
테이블 상에도 이 이름으로 칼럼이 들어가있나요? 그렇다면 풀 네임인 `quantity` 로의 전환을 제안드립니다. |
@@ -0,0 +1,57 @@
+package develop.baminchan.service;
+
+import develop.baminchan.dto.BanchanDto;
+import develop.baminchan.dto.CategoryDto;
+import develop.baminchan.entity.Banchan;
+import develop.baminchan.entity.Category;
+import develop.baminchan.repository.BanchanRepository;
+import develop.baminchan.repository.Ca... | Java | `logger` 사용해주세요. |
@@ -0,0 +1,57 @@
+package develop.baminchan.service;
+
+import develop.baminchan.dto.BanchanDto;
+import develop.baminchan.dto.CategoryDto;
+import develop.baminchan.entity.Banchan;
+import develop.baminchan.entity.Category;
+import develop.baminchan.repository.BanchanRepository;
+import develop.baminchan.repository.Ca... | Java | `.stream().map()` 사용으로 앞선 for loop이랑 여기까지 없앨 수 있어 보입니다. |
@@ -0,0 +1,57 @@
+package develop.baminchan.service;
+
+import develop.baminchan.dto.BanchanDto;
+import develop.baminchan.dto.CategoryDto;
+import develop.baminchan.entity.Banchan;
+import develop.baminchan.entity.Category;
+import develop.baminchan.repository.BanchanRepository;
+import develop.baminchan.repository.Ca... | Java | 여기도 `.stream().map()` 으로 바꿀 수 있습니다. |
@@ -0,0 +1,20 @@
+package develop.baminchan.dto.util;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public class StringConvertor {
+ private StringConvertor() {
+ }
+
+ public static Set<String> convertToSet(String column) {
+ if (column == null) {
+ return ... | Java | 데이터 변환을 위한 컨버터에 대한 표준 스펙이 있었군요..스프링 문서 전체적으로 꼭 한번 읽어봐야겠네요.
감사합니다. |
@@ -0,0 +1,94 @@
+package develop.baminchan.entity;
+
+import develop.baminchan.entity.banchan.BanchanDetail;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.relational.core.mapping.Embedded;
+
+public class Banchan {
+ @Id
+ private Long id;
+
+ private String detail_hash;
+ ... | Java | 다른 리뷰에서 이런 류의 생성자를 굉장히 싫어하신다고 했었는데 여기도 똑같은 부분 맞나요? |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | 비구조화 할당을 적용하면 더 좋을 것 같습니다. |
@@ -0,0 +1,23 @@
+import React from 'react';
+import './Comment.scss';
+
+class NewComment extends React.Component {
+ render() {
+ // const newArray = this.props.newComment.map((commentarray, index) => (
+ // <li key={index}>
+ // <span className="newCommentid">{this.props.nickname}</span>
+ // ... | JavaScript | - state 를 사용하지 않는다면, constructor 의 선언이 필요 없습니다! |
@@ -0,0 +1,15 @@
+.comment {
+ .newComment {
+ margin-bottom: 5px;
+ }
+
+ .newCommentid {
+ font-weight: bold;
+ margin-bottom: 0;
+ }
+
+ .newComments {
+ font-weight: normal;
+ margin-left: 5px;
+ }
+} | Unknown | - `.comment` 아래로 네스팅 해주세요! |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | - 구조 분해 할당 해주세요!
```suggestion
inputToComment = () => {
const { comment, commentInput } = this.state;
this.setState({
id: 'wecode_bootcamp',
comment: comment.concat(commentInput),
});
};
``` |
@@ -0,0 +1,23 @@
+import React from 'react';
+import './Comment.scss';
+
+class NewComment extends React.Component {
+ render() {
+ // const newArray = this.props.newComment.map((commentarray, index) => (
+ // <li key={index}>
+ // <span className="newCommentid">{this.props.nickname}</span>
+ // ... | JavaScript | - 컴포넌트와 동일하게 클래스네임 지어주시고, 첫글자를 대문자로 작성하는 컨벤션은 컴포넌트를 네이밍 하기 위한 컨벤션 입니다!
```suggestion
<div className="comment">
``` |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | - id 라는 값은 무슨 용도를 위해 작성해 주신 걸까요? id 는 꼭 필요한 부분이 아니라면 사용을 지양해주세요! id 값은 프로젝트 내에서 유일해야 합니다.
- id 를 사용하는 경우는 예를 들어, google map api 를 사용해서 지도를 그릴때, 지도를 그릴 html element 를 특정할 때 사용되곤 합니다. |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | - 여기도 id 를 사용하지 않는데 불필요하게 사용하는 것 같습니다! 지워주세요~ |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | - constructor 선언을 가장 위에 위치시켜주세요! |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | - defaultColor 와 disabled 는 state 로 관리하기에는 부적절한 값 같습니다. idInput 과 pwInput 를 사용해서 계산할 수 있는 값이기 때문입니다!
- 어떤 기준으로 state 를 만들어야 하는지에 대해서는 아래 문서를 참고해주세요!
- https://ko.reactjs.org/docs/thinking-in-react.html#step-3-identify-the-minimal-but-complete-representation-of-ui-state
- state 로 관리할 필요가 없는 값들은 state 를 만들지 않도록 해주세요. ... |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | - 구조 분해 할당 활용해 주시면 더 좋을 것 같습니다!
```suggestion
const { name, value } = event.target;
this.setState({
[name]: value,
});
``` |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | - defaultColor 와 disabled 를 state 에서 관리하지 않도록 한다면, 이 로직 부분은 더 이상 필요 없을 것 같습니다. |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | - idInput 과 pwInput 을 사용해서 바로 값을 계산할 수 있습니다. 코드는 다음과 같습니다. 참고해주세요!
- inline 스타일링을 주시는 것은 꼭 필요한 경우가 아니라면 지양해주시고, className 을 동적으로 부여하는 것으로 스타일링 해주세요!
- inline 스타일링을 사용하시는 경우는, 슬라이더를 구현과 같이 스타일링이 매우 많이 지속적으로 변해야 하는 상황에 사용해 주시는 겁니다!
```jsx
render () {
const { idInput, pwInput } = this.state;
isButtonActive = id... |
@@ -0,0 +1,46 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+@import '../../../styles/variable.scss';
+
+.Login {
+ .container {
+ width: 2000px;
+ max-width: 100vw;
+
+ .loginContainer {
+ width: 350px;
+ height: 400px;
+ margin: 25vh auto;
+ border: 2p... | Unknown | - common.scss 에 적합하는 것 같습니다! |
@@ -0,0 +1,46 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+@import '../../../styles/variable.scss';
+
+.Login {
+ .container {
+ width: 2000px;
+ max-width: 100vw;
+
+ .loginContainer {
+ width: 350px;
+ height: 400px;
+ margin: 25vh auto;
+ border: 2p... | Unknown | - mixin 은 variable.scss 와 같은 별도의 파일을 하나 더 만들어서 그곳에서 일괄적으로 관리해주세요! |
@@ -0,0 +1,46 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+@import '../../../styles/variable.scss';
+
+.Login {
+ .container {
+ width: 2000px;
+ max-width: 100vw;
+
+ .loginContainer {
+ width: 350px;
+ height: 400px;
+ margin: 25vh auto;
+ border: 2p... | Unknown | - 스타일링을 부여하기 위함으로는 className 으로도 충분합니다. id 를 사용하실 이유가 없습니다. |
@@ -1,13 +1,108 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import Nav from '../../../components/Nav/Nav';
+import CommentList from '../Comment/CommentList';
+import './Main.scss';
class MainAh extends React.Component {
render() {
return (
- <div>
- <p>명성</p>
+... | JavaScript | - 반복적인 구조가 보이네요! 그리고 사실 이 부분은 백엔드에서 정보를 받아와서 화면에 그리는 것이므로, 목업 데이터를 구성하셔서 map 함수를 사용하여 구현해주시는게 좋을 것 같습니다! |
@@ -1,13 +1,108 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import Nav from '../../../components/Nav/Nav';
+import CommentList from '../Comment/CommentList';
+import './Main.scss';
class MainAh extends React.Component {
render() {
return (
- <div>
- <p>명성</p>
+... | JavaScript | - 여기도 위와 동일합니다! |
@@ -0,0 +1,201 @@
+body {
+ margin: 0;
+}
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+.MainAh {
+ .mainContainer {
+ display: flex;
+ position: relative;
+ justify-content: center;
+ width: 2000px;
+ max-width: 100vw;
+ height: 2000px;
+ background-color: #fa... | Unknown | - reset.scss 에 적합해 보이네요! |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | 적용완료~! 다슬님 최고! |
@@ -0,0 +1,23 @@
+import React from 'react';
+import './Comment.scss';
+
+class NewComment extends React.Component {
+ render() {
+ // const newArray = this.props.newComment.map((commentarray, index) => (
+ // <li key={index}>
+ // <span className="newCommentid">{this.props.nickname}</span>
+ // ... | JavaScript | 지웠습니다! |
@@ -0,0 +1,15 @@
+.comment {
+ .newComment {
+ margin-bottom: 5px;
+ }
+
+ .newCommentid {
+ font-weight: bold;
+ margin-bottom: 0;
+ }
+
+ .newComments {
+ font-weight: normal;
+ margin-left: 5px;
+ }
+} | Unknown | 수정했습니다! |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | 적용했습니다. 구조 분해 할당이 익숙하지않아 써야할 곳을 잘 구분하지 못하는것 같습니다.. ㅠ |
@@ -0,0 +1,23 @@
+import React from 'react';
+import './Comment.scss';
+
+class NewComment extends React.Component {
+ render() {
+ // const newArray = this.props.newComment.map((commentarray, index) => (
+ // <li key={index}>
+ // <span className="newCommentid">{this.props.nickname}</span>
+ // ... | JavaScript | 아 이런 실수를 ... 수정했습니다! |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | 위에서 받아온 'wecode-bootcamp' 라는 id 값을 받아오기 위해 사용했는데, 확실히 id 라는것은 적절치 않아 nickname 으로 수정했습니다! |
@@ -0,0 +1,80 @@
+import React from 'react';
+import Comment from './Comment';
+import './CommentList.scss';
+
+class CommentList extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentInput: '',
+ newComment: [],
+ nickname: '',
+ commentList: [],
+ c... | JavaScript | 지웠습니다! |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | 수정했습니다! |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | defaultColor는 아예 지우고 삼항연산자를 이용한 해결방법을 밑에 주셔서 그거로 색상 변환까지 적용하였습니다. 상태가 변한다고 생각되는것은 자꾸 state를 이용하게 되는거 같아 더 공부하겠습니다. |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | 수정했습니다! |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | 하단에 주신 해결법으로 수정했습니다! |
@@ -1,13 +1,92 @@
import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
class LoginAh extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ idInput: '',
+ pwInput: '',
+ };
+ }
+
+ loginTest = () => {
+ fetch('users/... | JavaScript | 정말 감사합니다. 무조건 constructor 단에서 변화시키는 줄 알고 그곳에서만 해결하려고 했는데 render에서 변경하면 더 간단하게 되는 것 같습니다. inline 스타일링 지양하겠습니다!!! |
@@ -6,25 +6,33 @@ import { css } from '@emotion/react';
import Rating from '@/components/Rating';
import Profile from '../Profile';
import { formatDate } from '@/utils/format';
+import useModalStore from '@/stores/useModalStore';
+import useDeleteReview from '@/hooks/query/useDeleteReview';
+import ConfirmModal from... | Unknown | _:hammer_and_wrench: Refactor suggestion_
**에러 처리 로직 추가 필요**
`handleDelete` 함수에서 mutation 실패 시의 에러 처리가 누락되어 있습니다.
다음과 같이 `onError` 핸들러를 추가하는 것을 제안합니다:
```diff
const handleDelete = () => {
mutate(
{ reviewId: review.reviewId },
{
onSuccess: () => {
setModalName(null);
},
+... |
@@ -0,0 +1,15 @@
+{
+ "arrowParens": "always",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
+ "printWidth": 80,
+ "proseWrap": "always",
+ "quoteProps": "as-needed",
+ "semi": true,
+ "singleQuote": false,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": false,
... | Unknown | EOL이 있네요 |
@@ -10,7 +10,17 @@
"@babel/core": "^7.23.0",
"@babel/preset-env": "^7.22.20",
"babel-jest": "^29.7.0",
- "jest": "29.6.0"
+ "eslint": "^8.56.0",
+ "eslint-config-airbnb": "^19.0.4",
+ "eslint-config-prettier": "^9.1.0",
+ "eslint-plugin-import": "^2.29.1",
+ "eslint-plugin-jsx-a11y": "^... | Unknown | 오.. husky까지 |
@@ -0,0 +1,28 @@
+import GameMessage from "./GameMessage.js";
+import { VALID_INPUT_LENGTH } from "./gameConstants.js";
+
+class Validator {
+ static isValidInput(input) {
+ if (!this.isNumber(input))
+ throw new Error(GameMessage.INVALID_INPUT_NOT_A_NUMBER);
+ if (!this.isValidLength(input))
+ throw n... | JavaScript | 3이라는 숫자는 어떤 의미를 가지고 있는 숫자 같은데요,
이러한 숫자가 숫자 그대로 존재하는 것을 흔히 매직넘버라고 부릅니다.
따라서 이러한 숫자는 다음의 이유로 상수화 해주는 것이 좋습니다.
1. 예시로 숫자야구 게임의 숫자갯수가 4로 늘어났다. 그렇다면 모든 파일을 뒤져서 3을 4로 고쳐야한다. (변경에 용이하지 않다.)
2. 처음 온보딩 하는 사람은 이 숫자의 의미를 파악하기 힘들다. 코드 가독성이 줄어든다. |
@@ -0,0 +1,28 @@
+import GameMessage from "./GameMessage.js";
+import { VALID_INPUT_LENGTH } from "./gameConstants.js";
+
+class Validator {
+ static isValidInput(input) {
+ if (!this.isNumber(input))
+ throw new Error(GameMessage.INVALID_INPUT_NOT_A_NUMBER);
+ if (!this.isValidLength(input))
+ throw n... | JavaScript | 1. 코드를 다음과 같이 고치면 더 줄어듭니다 ㅎㅎ
```suggestion
const newArr = [...new Set(input)]
```
2. newArr이라는 상수명이 어떤 의미를 담고 있는 이름인가요? 의미가 없고, 단발성으로 사용되는 측면에서
이렇게 작성해도 될 것 같아요.
```js
isDuplicate(input) {
if ([...new Set(input)].length !== 3) throw new Error(GameMessage.INVALID_INPUT_IS_DUPLICATED)
return true;
}... |
@@ -0,0 +1,28 @@
+import GameMessage from "./GameMessage.js";
+import { VALID_INPUT_LENGTH } from "./gameConstants.js";
+
+class Validator {
+ static isValidInput(input) {
+ if (!this.isNumber(input))
+ throw new Error(GameMessage.INVALID_INPUT_NOT_A_NUMBER);
+ if (!this.isValidLength(input))
+ throw n... | JavaScript | 1. 개인적인 견해로는 검증함수에서는 해당 input이 유효한지/안한지(boolean) 평가한 다음,
이 결과에 따라 에러를 던져주는 패턴을 선호합니다.
다시 말하면 에러를 던져주는 부분을 이 함수(is..)를 호출하는 부분으로 넘기는 방식으로 하곤합니다
2. 이게 static method가 아닌 method일 이유가 있나요? |
@@ -0,0 +1,28 @@
+import GameMessage from "./GameMessage.js";
+import { VALID_INPUT_LENGTH } from "./gameConstants.js";
+
+class Validator {
+ static isValidInput(input) {
+ if (!this.isNumber(input))
+ throw new Error(GameMessage.INVALID_INPUT_NOT_A_NUMBER);
+ if (!this.isValidLength(input))
+ throw n... | JavaScript | 필요없는 주석은 지우면 좋겠습니다 ! |
@@ -0,0 +1,28 @@
+import GameMessage from "./GameMessage.js";
+import { VALID_INPUT_LENGTH } from "./gameConstants.js";
+
+class Validator {
+ static isValidInput(input) {
+ if (!this.isNumber(input))
+ throw new Error(GameMessage.INVALID_INPUT_NOT_A_NUMBER);
+ if (!this.isValidLength(input))
+ throw n... | JavaScript | boolean을 리턴할 때는 메서드의 prefix에 is, has를 붙여주는 것이 관례입니다ㅎ_ㅎ |
@@ -0,0 +1,49 @@
+import { Random } from "@woowacourse/mission-utils";
+import {
+ VALID_INPUT_LENGTH,
+ MIN_RANDOM_NUMBER,
+ MAX_RANDOM_NUMBER,
+} from "./gameConstants.js";
+
+class Computer {
+ #solution;
+
+ seeSolution() {
+ return this.#solution;
+ }
+
+ makeSolution() {
+ const computer = [];
+ w... | JavaScript | 어떤 구문에는 세미콜론이 있고, 어떤 구문에는 세미콜론이 있지 않네요.
둘 중 하나만 하시는 걸 추천드리고, 강제하고 싶다면 prettier등을 이용해보세요. |
@@ -0,0 +1,49 @@
+import { Random } from "@woowacourse/mission-utils";
+import {
+ VALID_INPUT_LENGTH,
+ MIN_RANDOM_NUMBER,
+ MAX_RANDOM_NUMBER,
+} from "./gameConstants.js";
+
+class Computer {
+ #solution;
+
+ seeSolution() {
+ return this.#solution;
+ }
+
+ makeSolution() {
+ const computer = [];
+ w... | JavaScript | 1. 이렇게도 됩니다.
```suggestion
const userInput = input.split("").map(Number);
```
2. 배열이면.. s가 붙으면 좋지 않을까요? |
@@ -0,0 +1,49 @@
+import { Random } from "@woowacourse/mission-utils";
+import {
+ VALID_INPUT_LENGTH,
+ MIN_RANDOM_NUMBER,
+ MAX_RANDOM_NUMBER,
+} from "./gameConstants.js";
+
+class Computer {
+ #solution;
+
+ seeSolution() {
+ return this.#solution;
+ }
+
+ makeSolution() {
+ const computer = [];
+ w... | JavaScript | reduce를 써서도 구현할 수 있겠네요
```js
const strikeAndBall = userInput.reduce((acc, cur) => {
if ((this.#solution.indexOf(item) === index) && this.#solution.includes(item)) return { ...acc, strike: acc.strike + 1 }
if ((this.#solution.indexOf(item) !== index) && this.#solution.includes(item)) return { ...acc, ball:acc.ball... |
@@ -0,0 +1,15 @@
+{
+ "arrowParens": "always",
+ "bracketSpacing": true,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
+ "printWidth": 80,
+ "proseWrap": "always",
+ "quoteProps": "as-needed",
+ "semi": true,
+ "singleQuote": false,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": false,
... | Unknown | 코드를 보면 prettier가 적용되어있지 않은데, 확인한번 해보세용 |
@@ -0,0 +1,49 @@
+import { Random } from "@woowacourse/mission-utils";
+import {
+ VALID_INPUT_LENGTH,
+ MIN_RANDOM_NUMBER,
+ MAX_RANDOM_NUMBER,
+} from "./gameConstants.js";
+
+class Computer {
+ #solution;
+
+ seeSolution() {
+ return this.#solution;
+ }
+
+ makeSolution() {
+ const computer = [];
+ w... | JavaScript | 이걸 리턴하는 이유가 뭔가요 ? |
@@ -1,5 +1,62 @@
+import { Console } from "@woowacourse/mission-utils";
+import User from "./User.js";
+import Computer from "./Computer.js";
+import Validator from "./Validator.js";
+import GameMessage from "./GameMessage.js";
+import { RETRY_RESPONSE, FULL_STRIKE } from "./gameConstants.js";
+
class App {
- async p... | JavaScript | indent가.. |
@@ -1,5 +1,62 @@
+import { Console } from "@woowacourse/mission-utils";
+import User from "./User.js";
+import Computer from "./Computer.js";
+import Validator from "./Validator.js";
+import GameMessage from "./GameMessage.js";
+import { RETRY_RESPONSE, FULL_STRIKE } from "./gameConstants.js";
+
class App {
- async p... | JavaScript | 매직넘버가 살아이있네용 |
@@ -1,5 +1,62 @@
+import { Console } from "@woowacourse/mission-utils";
+import User from "./User.js";
+import Computer from "./Computer.js";
+import Validator from "./Validator.js";
+import GameMessage from "./GameMessage.js";
+import { RETRY_RESPONSE, FULL_STRIKE } from "./gameConstants.js";
+
class App {
- async p... | JavaScript | 이렇게 eslint 규칙을 무시할거면 eslint를 왜 사용하시나요? |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | 로또 번호를 Set 으로 구현하는 것과 List 로 구현하는 것을 비교해 보았을 때 어떤 장단점이 있을까요? 여기서는 어떤 자료구조가 어울릴까요? |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | 한줄이더라도 괄호를 붙여주는걸 컨벤션으로 합시다.
이것이 간결하더라도 읽는 사람 입장으로 코드를 보면
당연히 있어야할 곳에 무언가가 빠지게 되면 가독성이 저하됩니다. (책 읽을 때와 비슷)
그리고 생성자에서 뭔가 많은 일을 해주는게 아쉽네요 |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | boolean을 int 로 변환해주는 이유는 뭔가요? |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | 이 부분 좀 더 개선해보세요 |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | x 를 좀 더 의미있는 변수이름으로 지었으면 좋았을 것 같습니다.
그리고 메소드 체이닝 방식에서는 길이가 길어지면 IDE에서 한눈에 확인하기 힘드니까
가독성을 위해 엔터로 라인정리를 어느정도 해주는 것이 좋습니다.
이를 위한 컨벤션도 intellij code style 에서 자동정렬 설정할 수 있긴 합니다(저는 사용중) |
@@ -1,10 +1,8 @@
package model;
-import util.ListGenerator;
import util.SplitGenerator;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -13,43 +11,44 @@ public class LottoMachine {
private static int LOTTO_NUMBER_RANGE = 45;
private stat... | Java | getter 와 헷갈리므로 calculateRandomNumbers 처럼 다른 단어를 활용해보시는걸 추천 |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | int 값으로 반환하는 메소드로 처음 구현하였는데 리팩토링 과정에서 boolean 타입으로 바꿀때 깜빡한 것같네요.. 실수하지 않도록 주의하겠습니다 |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | set과 List의 가장 큰 차이점은 중복을 허용하는지 안하는지로 알고있습니다.
이부분에서 set을 활용했을때 로또 번호가 6개가 될때까지 랜덤 숫자를 받는 방법이 있겠네요 시도해보겠습니다. |
@@ -1,28 +1,33 @@
package com.emotionalcart.product.application;
-import com.emotionalcart.core.feature.product.*;
-import com.emotionalcart.core.feature.provider.Provider;
-import com.emotionalcart.core.feature.review.Review;
import com.emotionalcart.core.exception.ErrorCode;
import com.emotionalcart.core.excepti... | Java | files.indexOf(file) + 1은 파일이 들어온 순서대로 표기 순서를 매겨주는 것인가요?? |
@@ -1,28 +1,33 @@
package com.emotionalcart.product.application;
-import com.emotionalcart.core.feature.product.*;
-import com.emotionalcart.core.feature.provider.Provider;
-import com.emotionalcart.core.feature.review.Review;
import com.emotionalcart.core.exception.ErrorCode;
import com.emotionalcart.core.excepti... | Java | 맞습니다! |
@@ -1,5 +1,12 @@
+import EventController from "./controller/EventController.js";
+
class App {
- async run() {}
+ constructor() {
+ this.eventController = new EventController();
+ }
+ async run() {
+ await this.eventController.eventStart();
+ }
}
export default App; | JavaScript | App 자체가 Controller라고 생각하고 구현을 하는 방법도 좋을 것 같습니다 |
@@ -0,0 +1,111 @@
+import { MENU, MESSAGE, ARRAY, CALENDAR, BENEFIT_AMOUNT, BADGE, BOUNDARY } from "../commons/constants.js";
+import Order from "./Order.js";
+import { getMenu, getMenuCount } from "../commons/utils.js";
+
+class Benefit {
+ #date;
+ #menu;
+ #order;
+ #benefitResult;
+
+ constructor(date, menu) {... | JavaScript | benefitResult를 Obejct로 구현하면 좀 더 가독성이 좋지 않을까 싶습니다 |
@@ -0,0 +1,88 @@
+import Benefit from "../src/model/Benefit.js";
+import { orderIntoArray } from "../src/commons/utils.js";
+
+describe("Benefit 클래스 테스트(혜택 있는 경우)", () => {
+ //given
+ const date = "3";
+ const menu = orderIntoArray("티본스테이크-1,바비큐립-1,초코케이크-2,제로콜라-1");
+ const benefit = new Benefit(date, menu);
+
+ ... | JavaScript | 테스트가 너무 한정되어 있는것 같습니다 test.each를 사용하여 좀 더 범위성 있게 테스트를 구현하는 방법이 좋을 것 같습니다 |
@@ -0,0 +1,63 @@
+import InputView from "../view/InputView.js";
+import OutputView from "../view/OutputView.js";
+import Order from "../model/Order.js";
+import Benefit from "../model/Benefit.js";
+import { print } from "../commons/utils.js";
+import { MENU } from "../commons/constants.js";
+
+class EventController {
+... | JavaScript | 각각의 디렉토리에 index.js 를 추가하고, 공통되게 export 시키면, import 를 간단하게 할 수 있습니다!
*view/index.js*
```javascript
export {default as InputView.js} from './InputView.js'
export {default as OutputView.js} from './OutputView.js'
```
*EventController.js*
```javascript
import { InputView, OutputView } '../view/index.js'
``` |
@@ -0,0 +1,111 @@
+import { MENU, MESSAGE, ARRAY, CALENDAR, BENEFIT_AMOUNT, BADGE, BOUNDARY } from "../commons/constants.js";
+import Order from "./Order.js";
+import { getMenu, getMenuCount } from "../commons/utils.js";
+
+class Benefit {
+ #date;
+ #menu;
+ #order;
+ #benefitResult;
+
+ constructor(date, menu) {... | JavaScript | ```javascript
this.#benefitResult = Array.from({length:5(혜택의 길이를 나타내는 상수로 수정)}, () => 0)
```
와 같이 바꾸는 것은 어떨까요? |
@@ -0,0 +1,111 @@
+import { MENU, MESSAGE, ARRAY, CALENDAR, BENEFIT_AMOUNT, BADGE, BOUNDARY } from "../commons/constants.js";
+import Order from "./Order.js";
+import { getMenu, getMenuCount } from "../commons/utils.js";
+
+class Benefit {
+ #date;
+ #menu;
+ #order;
+ #benefitResult;
+
+ constructor(date, menu) {... | JavaScript | 클래스 분리에 너무 집중하느라
혜택을 확인하는 클래스와 혜택을 적용하는 클래스로 분리해서 작성했었는데,
하나의 클래스에 묶어서 작성하는 것도 괜찮아 보이네요😂 |
@@ -0,0 +1,63 @@
+import InputView from "../view/InputView.js";
+import OutputView from "../view/OutputView.js";
+import Order from "../model/Order.js";
+import Benefit from "../model/Benefit.js";
+import { print } from "../commons/utils.js";
+import { MENU } from "../commons/constants.js";
+
+class EventController {
+... | JavaScript | Controller의 필드는 model의 필드를 통해 불러올 수 있다고 생각합니다!
필드를 줄여보는건 어떨까요? |
@@ -0,0 +1,63 @@
+import InputView from "../view/InputView.js";
+import OutputView from "../view/OutputView.js";
+import Order from "../model/Order.js";
+import Benefit from "../model/Benefit.js";
+import { print } from "../commons/utils.js";
+import { MENU } from "../commons/constants.js";
+
+class EventController {
+... | JavaScript | ERROR의 출력도 util 이 아닌 OutputView 에서 해주는건 어떨까요? |
@@ -0,0 +1,56 @@
+import { print, priceToString } from "../commons/utils.js";
+import { MESSAGE, ARRAY, BENEFIT_AMOUNT } from "../commons/constants.js";
+
+const OutputView = {
+ printStart() {
+ print(MESSAGE.START);
+ },
+
+ printOrderInformation(date, menu) {
+ print(MESSAGE.MONTH + date + MESSAGE.SHOW_BENE... | JavaScript | else 를 지양하라는 요구사항이 있어서,
위에 if문에 return 해주는 방식을 추천합니다! |
@@ -12,19 +12,22 @@
import nextstep.security.authorization.access.MvcRequestMatcher;
import nextstep.security.authorization.access.RequestMatcherEntry;
import nextstep.security.authorization.manager.AuthenticatedAuthorizationManager;
+import nextstep.security.authorization.manager.AuthorizationManager;
import nexts... | Java | 테스트를 위한 코드가 프로덕션 코드에 추가되어 있네요! 테스트 환경에서만 영향을 받도록 구조를 개선해보면 어떨까요? |
@@ -2,11 +2,24 @@
import nextstep.security.authentication.Authentication;
import nextstep.security.authorization.AuthorizationDecision;
+import nextstep.security.authorization.GrantedAuthority;
+import nextstep.security.authorization.role.NullRoleHierarchy;
+import nextstep.security.authorization.role.RoleHierarchy... | Java | ```suggestion
this(new NullRoleHierarchy());
```
소소하지만.. 주 생성자를 정해 하나의 생성자에서만 초기화를 담당하면 유지보수성을 높일 수 있습니다! |
@@ -0,0 +1,87 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.Set;
+
+import static org... | Java | 테스트 너무 좋네요 👍
추가로 순환 참조가 발생했을 때와 같은 예외 상황에 대한 테스트도 추가해보면 어떨까요? |
@@ -0,0 +1,148 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet... | Java | 지금은 stream 기능을 잘 활용해서 구현해 주셨는데요! 스프링과 같은 프레임워크의 경우 가독성보다 성능을 우선하기 때문에 stream 보단 for문을 선호하고 있습니다.
기존 애플리케이션의 방향성인 가독성보다 성능을 우선으로 구현해보는 것도 하나의 재미가 될 수 있을 것 같습니다 :) |
@@ -0,0 +1,148 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet... | Java | ```suggestion
Queue<GrantedAuthority> queue = new ArrayDeque<>(authorities);
```
BFS 알고리즘을 활용하여 잘 구현해 주셨네요 👍
알고리즘에 맞는 자료구조로 바꾼다면 성능이 더 올라갈 것 같습니다! |
@@ -0,0 +1,148 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet... | Java | 오... 그렇군요 !! 생각해보니 스프링이나 시큐리티 코드를 보면서 stream을 사용한 부분이 거의 안보인다 싶긴 했는데 성능적인 부분을 챙겨가는 것이었군요. 이부분은 for loop으로 변경해서 적용해보겠습니다. !! |
@@ -0,0 +1,87 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.Set;
+
+import static org... | Java | 생성시에 탐지하는 것이 좋을 것 같아 생성자쪽에 추가해보았습니다! |
@@ -12,19 +12,22 @@
import nextstep.security.authorization.access.MvcRequestMatcher;
import nextstep.security.authorization.access.RequestMatcherEntry;
import nextstep.security.authorization.manager.AuthenticatedAuthorizationManager;
+import nextstep.security.authorization.manager.AuthorizationManager;
import nexts... | Java | 테스트와 분리되니 코드가 명확하네요 👍 |
@@ -0,0 +1,148 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet... | Java | 너무 좋네용 💯 |
@@ -0,0 +1,90 @@
+package nextstep.app;
+
+import jakarta.servlet.http.HttpServletRequest;
+import nextstep.security.authorization.Secured;
+import nextstep.security.authorization.access.AnyRequestMatcher;
+import nextstep.security.authorization.access.MvcRequestMatcher;
+import nextstep.security.authorization.access.R... | Java | 현재 프로덕션 코드와 테스트 코드에서 동일한 설정이 중복되고 있는데, Spring에서 활용하는 Configurer 패턴(설정자 패턴)을 활용하면 확장성이 늘어나 중복을 없애볼 수 있겠네요~
시간이 남고 심심하실까봐 학습하면 좋을 내용 하나 던지고 갑니다 ㅋㅋ |
@@ -0,0 +1,148 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet... | Java | 반복문으로 깔끔하게 변경해 주셨네요 👍
미션의 다른 부분에는 아직 스트림 코드가 남아 있는데, 이번 변경이 해당 부분만 수정하는 것이 맞을까요?
다른 코드에 코멘트를 드리려 했는데, 혹시 의도하신 것인지 확인을 위해 리뷰 남깁니다. |
@@ -0,0 +1,148 @@
+package nextstep.security.authorization.role;
+
+import nextstep.security.SimpleGrantedAuthority;
+import nextstep.security.authorization.GrantedAuthority;
+
+import java.util.ArrayDeque;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet... | Java | 아 제가 다른곳에서도 사용중이었네요 🥲
이부분은 확인을 못했습니다 ㅎㅎㅎ
반영했습니다. 꼼꼼한 리뷰 감사합니다 ! |
@@ -0,0 +1,135 @@
+package christmas.validator;
+
+import christmas.constant.Constants;
+import christmas.constant.ErrorMessage;
+import christmas.constant.Menu;
+import christmas.util.Utils;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+impo... | Java | https://www.inflearn.com/questions/819415/verify-validate-check-is
verify, validate, check, is 의 네이밍 차이에 대해서 설명하는 글인데 참고하시면 좋을 것 같습니다! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.