Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 썸네일용 이미지를 png로 변환하지 않고 svg로 저장한다. #764

Merged
merged 21 commits into from
Jan 24, 2022

Conversation

tributetothemoon
Copy link
Collaborator

@tributetothemoon tributetothemoon commented Jan 20, 2022

구현 기능

  • svg to png 변환 로직을 전부 제거합니다.

논의하고 싶은 내용

  • 기존의 mapImageUrl 컬럼명을 무엇으로 바꾸면 좋을까요?!
  • API도 바뀌기 때문에 프론트엔드 분들도 논의해보면 좋을 것 같습니다~ @Puterism @SunYoungKwon @yujo11

공유하고 싶은 내용

  • 자연스럽게 BatikConverter(png로 변환해주던 의존성)가 의존성에서 제거되었습니다.
  • 이미지를 데이터베이스에 그대로 저장하기 때문에 AWS S3 의존성도 없어졌습니다. (S3 Proxy F/O)
  • 서브 모듈 업데이트!!

Close #756

dusdn1702
dusdn1702 previously approved these changes Jan 21, 2022
Copy link
Collaborator

@dusdn1702 dusdn1702 left a comment

Choose a reason for hiding this comment

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

굿 좋습니다 빠른 진행 가시죠!

sakjung
sakjung previously approved these changes Jan 22, 2022
Copy link
Collaborator

@sakjung sakjung left a comment

Choose a reason for hiding this comment

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

확인했습니다! 좋습니다~ 넘넘 수고하셨습니다
s3 proxy 서버 제거도 @tributetothemoon 이 같이 진행하는거죠?
Warmer에서 S3 Proxy로 웜업하는 것도 이제 필요없을 것 같은데 이 부분은 제가 처리할게요!

Copy link
Collaborator

@xrabcde xrabcde left a comment

Choose a reason for hiding this comment

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

편-안

image

@@ -0,0 +1 @@
ALTER TABLE map CHANGE COLUMN map_image_url thumbnail longtext not null;
Copy link
Collaborator

@xrabcde xrabcde Jan 23, 2022

Choose a reason for hiding this comment

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

여기에 TRUNCATE 코드도 추가해주세욥 ~!

# 외래키 검사 옵션 해제
SET foreign_key_checks = 0;

# DB 전체 테이블에 대한 truncate 실행
TRUNCATE TABLE map;
TRUNCATE TABLE member;
TRUNCATE TABLE preset;
TRUNCATE TABLE reservation;
TRUNCATE TABLE space;

# 외래키 검사 옵션 복원
SET foreign_key_checks = 1;

TRUNCATE 코드 이렇게 작성하시면 됩니다 ~ (주석은 빼고)
잘 되는지 궁금해서 로컬에서 테스트 해봤어요 ㅋㅋㅋㅋ
flyway_schema_table은 날리지 않도록 주의 ~~

순서는 TRUNCATE > ALTER TABLE 로 해주세요 ~!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

설정했습니다~~

Copy link
Collaborator

Choose a reason for hiding this comment

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

good~

@@ -40,7 +41,7 @@
private SlackService slackService;

private static final Member POBI = new Member(memberSaveRequest.getEmail(), memberSaveRequest.getPassword(), memberSaveRequest.getOrganization());
private static final Map LUTHER = new Map(LUTHER_NAME, MAP_DRAWING_DATA, MAP_IMAGE_URL, POBI);
private static final Map LUTHER = new Map(LUTHER_NAME, MAP_DRAWING_DATA, Constants.MAP_SVG, POBI);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
private static final Map LUTHER = new Map(LUTHER_NAME, MAP_DRAWING_DATA, Constants.MAP_SVG, POBI);
private static final Map LUTHER = new Map(LUTHER_NAME, MAP_DRAWING_DATA, MAP_SVG, POBI);

그... Constants.~ 이렇게 쓰고 있는 애들이요.. Constants 다 빼도 되지 않나요? ㅋㅋㅋ
별건 아닌데 통일성을 맞추면 좋을 것 같아서,,,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

왜 이렇게 나왔을까요... 전부 바꿨습니다.

@@ -62,7 +63,7 @@ void setUp() {
SALLY_DESCRIPTION);

Member pobi = new Member(EMAIL, passwordEncoder.encode(PW), ORGANIZATION);
Map luther = new Map(LUTHER_NAME, MAP_DRAWING_DATA, MAP_IMAGE_URL, pobi);
Map luther = new Map(LUTHER_NAME, MAP_DRAWING_DATA, Constants.MAP_SVG, pobi);
Copy link
Collaborator

Choose a reason for hiding this comment

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

보니까 전체적으로 이번에 추가한 MAP_SVG에만 Constants 붙어있는 것 같네유

sakjung
sakjung previously approved these changes Jan 23, 2022
Copy link
Collaborator

@sakjung sakjung left a comment

Choose a reason for hiding this comment

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

ㅈㅍㄹㅂ

dusdn1702
dusdn1702 previously approved these changes Jan 23, 2022
Copy link
Collaborator

@dusdn1702 dusdn1702 left a comment

Choose a reason for hiding this comment

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

ㅉㅍㄹㅂ

xrabcde
xrabcde previously approved these changes Jan 23, 2022
Copy link
Collaborator

@xrabcde xrabcde left a comment

Choose a reason for hiding this comment

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

좋습니다~! 많이 날라가네요 ㅋㅋㅋㅋ

@@ -72,7 +72,7 @@ public boolean doesNotHaveSpaceId(final Long spaceId) {
}

public void updateImageUrl(final String mapImageUrl) {
this.mapImageUrl = mapImageUrl;
this.thumbnail = mapImageUrl;
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 친구는 왜 아직 ImageUrl 인가요!

Suggested change
this.thumbnail = mapImageUrl;
this.thumbnail = thumbnail;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

헐 얼른 수정할게요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

꼼꼼한 체크 진심으로 감사합니다🙇‍♂️

@@ -0,0 +1 @@
ALTER TABLE map CHANGE COLUMN map_image_url thumbnail longtext not null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

good~

@tributetothemoon tributetothemoon dismissed stale reviews from xrabcde, dusdn1702, and sakjung via da31209 January 24, 2022 15:29
Copy link
Collaborator

@dusdn1702 dusdn1702 left a comment

Choose a reason for hiding this comment

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

수고했습니다~~

@xrabcde xrabcde merged commit 2612899 into dev Jan 24, 2022
@xrabcde xrabcde deleted the refactor/756-eliminate-svg-png-convert branch January 24, 2022 15:31
This was referenced Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 썸네일용 이미지를 png로 변환하지 않고 svg로 저장한다.
4 participants