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
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3c1c42c
refactor: svg to png 변환 로직 삭제
tributetothemoon Jan 18, 2022
cbf9024
chore: svg to png dependecies 제거
tributetothemoon Jan 18, 2022
0ddddf2
refactor: 테스트에서 썸네일 이미지 url을 사용하지 않도록 수정
tributetothemoon Jan 18, 2022
87f7435
refactor: map의 mapImageUrl 컬럼명 변경 (-> thumbnail)
tributetothemoon Jan 20, 2022
02df732
refactor: Dataloader 썸네일 데이터 svg로 변경
tributetothemoon Jan 20, 2022
291c3f4
refactor: S3Proxy 프로젝트 삭제
tributetothemoon Jan 20, 2022
5a0aca3
chore: S3 Proxy에서 사용하는 서브모듈 제거
tributetothemoon Jan 21, 2022
360f0ad
refactor: MapCreateUpdateRequest DTO 썸네일 컬럼명 변경
tributetothemoon Jan 21, 2022
930170f
Merge branch 'dev' into refactor/756-eliminate-svg-png-convert
tributetothemoon Jan 21, 2022
8eaa434
refactor: S3 Proxy 관련 Warm-up 코드 삭제
tributetothemoon Jan 23, 2022
8bcc9fc
refactor: svg converter 관련 warm-up 코드 삭제
tributetothemoon Jan 23, 2022
ce7b78e
feat 서브모듈 업데이트
tributetothemoon Jan 23, 2022
f85e4c2
refactor: s3 proxy 관련 서브모듈 설정 삭제
tributetothemoon Jan 23, 2022
0aa91ff
refactor: truncate 코드 추가
tributetothemoon Jan 23, 2022
4be7942
refactor: warm-up 관련 클래스 제거
tributetothemoon Jan 23, 2022
ea7321e
refactor: SharingIdGeneratorTest 디렉토리 이동
tributetothemoon Jan 23, 2022
f844812
refactor: S3ProxyUploader 테스트 파일 삭제
tributetothemoon Jan 23, 2022
9b1b28f
chore: 서브모듈 롤백
tributetothemoon Jan 23, 2022
e506bda
refactor: truncate, alter table 순서 재정렬
tributetothemoon Jan 23, 2022
1e272ae
refactor: 테스트용 상수 클래스명 명시하지 않도록 변경
tributetothemoon Jan 23, 2022
da31209
refactor: Map updateImageUrl -> updateThumbnail 명칭 수정
tributetothemoon Jan 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@
path = backend/src/main/resources/config
url = git@github.com:zzimkkong/config.git
branch = main
[submodule "s3proxy/src/main/resources/s3proxy-config"]
path = s3proxy/src/main/resources/s3proxy-config
url = git@github.com:zzimkkong/s3proxy-config.git
branch = main
[submodule "s3proxy/src/main/resources/config"]
path = s3proxy/src/main/resources/config
url = git@github.com:zzimkkong/config.git
branch = main
6 changes: 0 additions & 6 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ dependencies {
// Jwt
implementation 'io.jsonwebtoken:jjwt:0.9.1'

// SvgToPng
implementation 'org.apache.xmlgraphics:batik-all:1.12'
implementation 'org.apache.xmlgraphics:xmlgraphics-commons:2.4'
implementation 'xml-apis:xml-apis:1.4.01'
implementation 'xml-apis:xml-apis-ext:1.3.04'

// Cryptor
implementation 'commons-codec:commons-codec:1.15'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void run(String... args) {
new Map(
"루터회관",
"{'id': '1', 'type': 'polyline', 'fill': '', 'stroke': 'rgba(111, 111, 111, 1)', 'points': '['60,250', '1,231', '242,252']', 'd': '[]', 'transform': ''}",
"https://d1dgzmdd5f1fx6.cloudfront.net/thumbnails-local/1.png",
"<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"950\" height=\"610\"><polyline points=\"40,560 300,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,440 130,440\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,440 130,440\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,460 110,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,350 110,440\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,330 300,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,270 300,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"220,270 220,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"140,270 140,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"240,270 300,270\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"160,270 220,270\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,280 110,310\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,310 120,310\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,310 120,280\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,280 110,280\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"110,500 40,500\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"50,560 50,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"40,200 100,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,200 120,130\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,130 40,130\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"90,200 90,240\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"90,240 50,240\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"140,200 300,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"120,60 120,140\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,330 400,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,330 600,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"450,350 430,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"430,370 440,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"440,370 440,410\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"440,410 460,410\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,410 460,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,370 470,370\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"470,370 450,350\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"450,260 460,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,260 460,70\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"460,70 450,70\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"450,70 450,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,260 600,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,190 520,170\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"520,170 520,120\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"520,120 540,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"540,100 560,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"560,100 580,120\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"580,120 580,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,260 630,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,220 630,220\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,180 630,180\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,140 630,140\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,100 630,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,140 630,160\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,180 630,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,220 630,240\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,330 600,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,260 630,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,290 500,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,290 500,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,270 330,270\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"330,270 330,330\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,230 680,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,230 680,180\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,60 300,200\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"40,60 910,60\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"910,60 910,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"910,560 600,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,230 910,230\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"820,230 820,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"730,230 730,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,290 800,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"840,290 910,290\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"680,60 680,100\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"40,60 40,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"500,190 500,60\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"370,330 370,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"300,560 370,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"530,330 530,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"530,560 600,560\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"600,60 600,260\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><polyline points=\"630,80 630,120\" stroke=\"#333333\" stroke-width=\"3\" stroke-linecap=\"round\"></polyline><g data-testid=\"42\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"110\" y=\"440\" width=\"190\" height=\"120\" fill=\"#0060FF\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"205\" y=\"500\" class=\"sc-carFqZ hTwlVf\">프론트 강의실1</text></g><g data-testid=\"43\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"110\" y=\"330\" width=\"190\" height=\"110\" fill=\"#0060FF\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"205\" y=\"385\" class=\"sc-carFqZ hTwlVf\">프론트 강의실 2</text></g><g data-testid=\"46\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"220\" y=\"270\" width=\"80\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"260\" y=\"300\" class=\"sc-carFqZ hTwlVf\">회의실 3</text></g><g data-testid=\"47\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"140\" y=\"270\" width=\"80\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"180\" y=\"300\" class=\"sc-carFqZ hTwlVf\">회의실 4</text></g><g data-testid=\"48\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"40\" y=\"130\" width=\"80\" height=\"70\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"80\" y=\"165\" class=\"sc-carFqZ hTwlVf\">회의실 5</text></g><g data-testid=\"50\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"220\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"240\" class=\"sc-carFqZ hTwlVf\">1</text></g><g data-testid=\"51\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"180\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"200\" class=\"sc-carFqZ hTwlVf\">2</text></g><g data-testid=\"52\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"140\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"160\" class=\"sc-carFqZ hTwlVf\">3</text></g><g data-testid=\"53\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"100\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"120\" class=\"sc-carFqZ hTwlVf\">4</text></g><g data-testid=\"55\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"40\" y=\"500\" width=\"70\" height=\"60\" fill=\"#FFEE58\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"75\" y=\"530\" class=\"sc-carFqZ hTwlVf\">방송실</text></g><g data-testid=\"56\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"50\" y=\"200\" width=\"40\" height=\"40\" fill=\"#FFEE58\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"70\" y=\"220\" class=\"sc-carFqZ hTwlVf\">전화</text></g><g data-testid=\"67\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"330\" width=\"310\" height=\"230\" fill=\"#6BC2F9\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"755\" y=\"445\" class=\"sc-carFqZ hTwlVf\">백엔드 강의실</text></g><g data-testid=\"68\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"820\" y=\"230\" width=\"90\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"865\" y=\"260\" class=\"sc-carFqZ hTwlVf\">회의실 1</text></g><g data-testid=\"69\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"730\" y=\"230\" width=\"90\" height=\"60\" fill=\"#EB3933\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"775\" y=\"260\" class=\"sc-carFqZ hTwlVf\">회의실 2</text></g><g data-testid=\"70\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"600\" y=\"60\" width=\"30\" height=\"40\" fill=\"#8B5CF6\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"615\" y=\"80\" class=\"sc-carFqZ hTwlVf\">5</text></g><g data-testid=\"71\" class=\"sc-ciSkZP bwSYJA\"><rect x=\"500\" y=\"60\" width=\"100\" height=\"200\" fill=\"#5CAC1E\" opacity=\"0.3\" class=\"sc-jcwpoC kyvWZW\"></rect><text x=\"550\" y=\"160\" class=\"sc-carFqZ hTwlVf\">트랙방</text></g></svg>",
pobi)
);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions backend/src/main/java/com/woowacourse/zzimkkong/domain/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Map {

@Column(nullable = false)
@Lob
private String mapImageUrl;
private String thumbnail;

@ManyToOne
@JoinColumn(name = "member_id", foreignKey = @ForeignKey(name = "fk_map_member"), nullable = false)
Expand All @@ -35,19 +35,19 @@ public class Map {
@OneToMany(mappedBy = "map", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, orphanRemoval = true)
private List<Space> spaces = new ArrayList<>();

public Map(final String name, final String mapDrawing, final String mapImageUrl, final Member member) {
public Map(final String name, final String mapDrawing, final String thumbnail, final Member member) {
this.name = name;
this.mapDrawing = mapDrawing;
this.mapImageUrl = mapImageUrl;
this.thumbnail = thumbnail;
this.member = member;

if (member != null) {
member.addMap(this);
}
}

public Map(final Long id, final String name, final String mapDrawing, final String mapImageUrl, final Member member) {
this(name, mapDrawing, mapImageUrl, member);
public Map(final Long id, final String name, final String mapDrawing, final String thumbnail, final Member member) {
this(name, mapDrawing, thumbnail, member);
this.id = id;
}

Expand All @@ -72,7 +72,7 @@ public Optional<Space> findSpaceById(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.

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

}

public void addSpace(final Space space) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public class MapCreateUpdateRequest {
private String mapDrawing;

@NotBlank(message = EMPTY_MESSAGE)
private String mapImageSvg;
private String thumbnail;

public MapCreateUpdateRequest(final String mapName, final String mapDrawing, final String mapImageSvg) {
public MapCreateUpdateRequest(final String mapName, final String mapDrawing, final String thumbnail) {
this.mapName = mapName;
this.mapDrawing = mapDrawing;
this.mapImageSvg = mapImageSvg;
this.thumbnail = thumbnail;
}
}
Loading