Skip to content

Enhance: Object -> JSONObject 변환 기능 추가#29

Merged
chamchi00800 merged 1 commit intoinnohack2021:devfrom
greenaloud:dev
Nov 27, 2021
Merged

Enhance: Object -> JSONObject 변환 기능 추가#29
chamchi00800 merged 1 commit intoinnohack2021:devfrom
greenaloud:dev

Conversation

@greenaloud
Copy link
Copy Markdown
Contributor

@greenaloud greenaloud commented Nov 26, 2021

Object -> JSONObject 변환 기능 추가

종류

  • New Feature

내용

ObjectToJson.java 파일 추가
핵심 기능인 Object -> JSONObject 변환 기능 추가
현재 단일 ReferenceObject, String, 기본타입 Wrapper 클래스인 경우에만 정상동작

연관된 이슈

close #28

Object 에서 JSONObject 로 변환하는 함수 추가
@greenaloud greenaloud added Enhancement 기능구현 Priority: high 우선순위 높음 labels Nov 26, 2021
@greenaloud greenaloud self-assigned this Nov 26, 2021
Copy link
Copy Markdown
Contributor

@Jack-R-lantern Jack-R-lantern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

멘토님이 제시한 방향이 기본적인것 부터 구현하라는 요구를 잘 구현한것을 확인했습니다.
감사합니다.

Comment on lines +23 to +52
if(value instanceof String){
map.put(key, value.toString());
continue;
}

if(value instanceof Double){
if(((Double)value).isInfinite() || ((Double)value).isNaN())
map.put(key, "null");
else
map.put(key, value);
continue;
}

if(value instanceof Float){
if(((Float)value).isInfinite() || ((Float)value).isNaN())
map.put(key, "null");
else
map.put(key, value);
continue;
}

if(value instanceof Number){
map.put(key, value);
continue;
}

if(value instanceof Boolean){
map.put(key, value);
continue;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primitive 타입을 찾는 로직을 확인했습니다.
내부적으로 논의한 JSON의 값이 숫자일때 명확히 어떻게 동작하는지만 확인하면 될것 같습니다.

Comment on lines +56 to +59
if(value instanceof Object){
JSONObject newMap = toJson(value);
map.put(key, newMap);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON의 value의 object가 다양한 wrapper를 포함할때 로직을 어떻게 구현해야할지는
다같이 좀 더 고민해봐야할것 같습니다.

@chamchi00800 chamchi00800 merged commit c24a0c8 into innohack2021:dev Nov 27, 2021
@chamchi00800
Copy link
Copy Markdown

primitive 타입일 때 받는 테스트 잘 확인했습니다.

247programmers added a commit to 247programmers/HotSource that referenced this pull request Nov 27, 2021
* Add JSON에서 엔티티 변환

* feat: add new feature (innohack2021#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* docs : GUIDELINE 폴더 수정 (innohack2021#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정
for (Field field : fields) {
field.setAccessible(true);
String key = field.getName();
// Object 인 경우 || String, Wrapper Type 인 경우 || Array 인 경우??? 여튼 조건이 필요하다
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가 구현 부분 확인했습니다!

Copy link
Copy Markdown

@chamchi00800 chamchi00800 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Copy Markdown

@chamchi00800 chamchi00800 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘확인했습니다.!

chamchi00800 pushed a commit that referenced this pull request Nov 27, 2021
* Add JSON에서 엔티티 변환

* Add JSON에서 엔티티 변환

* feat: add new feature (#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* docs : GUIDELINE 폴더 수정 (#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정

* Add 오브젝트 변환 초기기능 구현 완료

* Fix build.yml Syntax 수정

* 가이드라인 삭제

Co-authored-by: 조원우 <64305493+greenaloud@users.noreply.github.com>
Co-authored-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Co-authored-by: 247programmers <79981382+247programmers@users.noreply.github.com>
chamchi00800 pushed a commit that referenced this pull request Nov 27, 2021
* Add JSON에서 엔티티 변환

* Add JSON에서 엔티티 변환

* feat: add new feature (#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* docs : GUIDELINE 폴더 수정 (#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정

* Add 오브젝트 변환 초기기능 구현 완료

* Fix build.yml Syntax 수정

* 가이드라인 삭제

* Fix ListType 초기화 실패

* Rename Build.yml -> SonarCloud.yml

* Fix ListType 초기화 실패 #35

Co-authored-by: 조원우 <64305493+greenaloud@users.noreply.github.com>
Co-authored-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Co-authored-by: 247programmers <79981382+247programmers@users.noreply.github.com>
chamchi00800 pushed a commit that referenced this pull request Nov 28, 2021
* Add JSON에서 엔티티 변환

* Add JSON에서 엔티티 변환

* feat: add new feature (#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* docs : GUIDELINE 폴더 수정 (#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정

* Add 오브젝트 변환 초기기능 구현 완료

* Fix build.yml Syntax 수정

* 가이드라인 삭제

* Fix ListType 초기화 실패

* Rename Build.yml -> SonarCloud.yml

* Fix ListType 초기화 실패 #35

* Delete Exception

* Refactor 전체적인 코드취약점

* Refactor 전체적인 코드취약점 #37

Co-authored-by: 조원우 <64305493+greenaloud@users.noreply.github.com>
Co-authored-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Co-authored-by: 247programmers <79981382+247programmers@users.noreply.github.com>
chamchi00800 pushed a commit that referenced this pull request Nov 28, 2021
* Add JSON에서 엔티티 변환

* Add JSON에서 엔티티 변환

* feat: add new feature (#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* Env: GithubAction 변경

*environment: SonarCloud main브렌치에서만 동작하게 변경

* docs : GUIDELINE 폴더 수정 (#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정

* Add 오브젝트 변환 초기기능 구현 완료

* Fix build.yml Syntax 수정

* 가이드라인 삭제

* Fix ListType 초기화 실패

* Rename Build.yml -> SonarCloud.yml

* Fix ListType 초기화 실패 #35

* Delete Exception

* Refactor 전체적인 코드취약점

* Refactor 전체적인 코드취약점 #37

* FileToObject

* retry, rm FileToObject, rm ObjectToFile.getpwd()

* Fix get ListType 받을 수 없던 문제

* plz22

* merge

* Fix test

* Refactor 코드 수정

* Refactor 코드 수정

Co-authored-by: 조원우 <64305493+greenaloud@users.noreply.github.com>
Co-authored-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Co-authored-by: 247programmers <79981382+247programmers@users.noreply.github.com>
Co-authored-by: FeFe2200 <67796301+FeFe2200@users.noreply.github.com>
Co-authored-by: fefe2200 <dlcjf2200@naver.com>
chamchi00800 pushed a commit that referenced this pull request Nov 28, 2021
* Add JSON에서 엔티티 변환

* Add JSON에서 엔티티 변환

* feat: add new feature (#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* Env: GithubAction 변경

*environment: SonarCloud main브렌치에서만 동작하게 변경

* docs : GUIDELINE 폴더 수정 (#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정

* Add 오브젝트 변환 초기기능 구현 완료

* Fix build.yml Syntax 수정

* 가이드라인 삭제

* Fix ListType 초기화 실패

* Rename Build.yml -> SonarCloud.yml

* Fix ListType 초기화 실패 #35

* Delete Exception

* Refactor 전체적인 코드취약점

* Refactor 전체적인 코드취약점 #37

* FileToObject

* retry, rm FileToObject, rm ObjectToFile.getpwd()

* Fix get ListType 받을 수 없던 문제

* plz22

* fin.

Co-authored-by: SIOUkoeran <alstnalsgud@gmail.com>
Co-authored-by: 조원우 <64305493+greenaloud@users.noreply.github.com>
Co-authored-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Co-authored-by: 247programmers <79981382+247programmers@users.noreply.github.com>
chamchi00800 pushed a commit that referenced this pull request Nov 29, 2021
* Add JSON에서 엔티티 변환

* Add JSON에서 엔티티 변환

* feat: add new feature (#29)

Object 에서 JSONObject 로 변환하는 함수 추가

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Add JSONObject 오브젝트 타입 받기

* Env: GithubAction 변경

*environment: main브렌치에서 이벤트를 감지하게 변경

* Env: GithubAction 변경

*environment: SonarCloud main브렌치에서만 동작하게 변경

* docs : GUIDELINE 폴더 수정 (#30)

docs : GUIDELINE폴더 내용 파일 가독성 향상을 위한 파일 수정

* Add 오브젝트 변환 초기기능 구현 완료

* Fix build.yml Syntax 수정

* 가이드라인 삭제

* Fix ListType 초기화 실패

* Rename Build.yml -> SonarCloud.yml

* Fix ListType 초기화 실패 #35

* Delete Exception

* Refactor 전체적인 코드취약점

* Refactor 전체적인 코드취약점 #37

* FileToObject

* retry, rm FileToObject, rm ObjectToFile.getpwd()

* Fix get ListType 받을 수 없던 문제

* plz22

* merge

* Fix test

* Refactor 코드 수정

* Refactor 코드 수정

* merge

* Add javaDoc

Co-authored-by: 조원우 <64305493+greenaloud@users.noreply.github.com>
Co-authored-by: Jack-R-lantern <tjdfkr2421@gmail.com>
Co-authored-by: 247programmers <79981382+247programmers@users.noreply.github.com>
Co-authored-by: FeFe2200 <67796301+FeFe2200@users.noreply.github.com>
Co-authored-by: fefe2200 <dlcjf2200@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement 기능구현 Priority: high 우선순위 높음

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants