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

Ignore: ๐Ÿ›๐Ÿ”ง Modification and refactoring of the presigned URL creation and conversion logic #179

Merged
merged 26 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c934952
style: url_generator ํŒจํ‚ค์ง€ ๊ฒฝ๋กœ ์ˆ˜์ •
psychology50 Oct 18, 2024
d29ff50
rename: user_id ๋กœ์šฐ ์Šค๋„ค์ดํฌ ์ผ€์ด์Šค๋กœ ํ†ต์ผ
psychology50 Oct 18, 2024
5d4ef92
rename: storage service -> presigend_url_generate_adapter
psychology50 Oct 18, 2024
274b7b2
fix: presigned_url_dto ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์ถ”๊ฐ€
psychology50 Oct 18, 2024
6b0e9a7
fix: presigned_url dto ext ์œ ํšจ์„ฑ ์˜ต์…˜ ์ถ”๊ฐ€ ๋ฐ id ํƒ€์ž… ์ˆ˜์ •
psychology50 Oct 18, 2024
7d6ecdc
fix: generator util๋กœ ๋Œ€์ฒด
psychology50 Oct 18, 2024
67c4453
feat: type๋ณ„ property data type ๊ฐ์ฒด ์ƒ์„ฑ
psychology50 Oct 18, 2024
b943025
feat: presiend_url_property_factory
psychology50 Oct 18, 2024
7c2a087
fix: object key template ๋ฉ”์„œ๋“œ url generator์— ํ†ตํ•ฉ
psychology50 Oct 18, 2024
7a1dacb
fix: service ๋กœ์ง์—์„œ ํŒŒ๋ผ๋ฏธํ„ฐ ํŒฉํ† ๋ฆฌ ์ „๋‹ฌํ•˜๋„๋ก ์ˆ˜์ •
psychology50 Oct 18, 2024
ca8956c
fix: use_case๊ฐ€ service๋ฅผ ํ˜ธ์ถœํ•˜์ง€ ์•Š๋Š” ๋ฌธ์ œ ์ˆ˜์ •
psychology50 Oct 18, 2024
07ef464
refactor: key pattern -> generator๋กœ ์—ญํ•  ์–‘๋„
psychology50 Oct 18, 2024
a04ff89
fix: ๋ถˆํ•„์š”ํ•ด์ง„ object key type ๋ฉ”์„œ๋“œ ์ œ๊ฑฐ
psychology50 Oct 18, 2024
d309b62
fix: ์ˆ˜์ •๋œ origin url generator ์ ์šฉ
psychology50 Oct 18, 2024
ab8759a
test: storage_controller_test ์ˆ˜์ •
psychology50 Oct 18, 2024
5a7c75b
test: ๋ชจ๋“  type์— ๋Œ€ํ•ด ์˜ฌ๋ฐ”๋ฅธ ์ผ€์ด์Šค ํ…Œ์ŠคํŠธ
psychology50 Oct 18, 2024
c99944a
test: ํ…Œ์ŠคํŠธ ์‹คํŒจ ์‹œ, 422์—๋Ÿฌ๋กœ ์ˆ˜์ •
psychology50 Oct 18, 2024
f4d4a86
fix: constructor ์˜ค๋ฅ˜๋กœ ์ธํ•ด, validator ์ฒด์ปค ์™ธ๋ถ€๋กœ ์ด์ „
psychology50 Oct 18, 2024
70f853f
feat: init binder๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ปค์Šคํ…€ validator ๋“ฑ๋ก
psychology50 Oct 18, 2024
e186144
feat: cusom_validation_exception handler ๋“ฑ๋ก
psychology50 Oct 18, 2024
8d78540
test: presigned_url_property_factory_test
psychology50 Oct 18, 2024
da592af
test: url generator test
psychology50 Oct 18, 2024
e15cbe5
fix: object key type chat_profile { ๋ˆ„๋ฝ ์ˆ˜์ •
psychology50 Oct 18, 2024
b247034
fix: ๊ฐ property type ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์ˆ˜์ •
psychology50 Oct 18, 2024
0e1c1b6
docs: swagger ๋ฌธ์„œ ์—…๊ทธ๋ ˆ์ด๋“œ
psychology50 Oct 18, 2024
d237137
fix: presentation ๊ณ„์ธต log aspcet์—์„œ response_entity is null์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ์ฒ˜๋ฆฌ
psychology50 Oct 18, 2024
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
Prev Previous commit
Next Next commit
fix: object key template ๋ฉ”์„œ๋“œ url generator์— ํ†ตํ•ฉ
  • Loading branch information
psychology50 committed Oct 18, 2024
commit 7c2a08737bc18af5681e19545bcaa46f362bc290

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package kr.co.pennyway.infra.client.aws.s3.url.generator;

import kr.co.pennyway.infra.client.aws.s3.ObjectKeyTemplate;
import kr.co.pennyway.infra.client.aws.s3.url.properties.PresignedUrlProperty;

import java.util.Map;

public final class UrlGenerator {
/**
* S3์— ์ž„์‹œ ์—…๋กœ๋“œํ•  ํŒŒ์ผ์˜ URL์„ ์ƒ์„ฑํ•œ๋‹ค.
Expand All @@ -11,7 +12,7 @@ public final class UrlGenerator {
* @return Presigned URL
*/
public static String createDeleteUrl(PresignedUrlProperty property) {
return ObjectKeyTemplate.apply(property.type().getDeleteTemplate(), property.variables());
return applyTemplate(property.type().getDeleteTemplate(), property.variables());
}

/**
Expand All @@ -21,6 +22,14 @@ public static String createDeleteUrl(PresignedUrlProperty property) {
* @return Presigned URL
*/
public static String createOriginUrl(PresignedUrlProperty property) {
return ObjectKeyTemplate.apply(property.type().getOriginTemplate(), property.variables());
return applyTemplate(property.type().getOriginTemplate(), property.variables());
}

private static String applyTemplate(String template, Map<String, String> variables) {
String result = template;
for (Map.Entry<String, String> entry : variables.entrySet()) {
result = result.replace("{" + entry.getKey() + "}", entry.getValue());
}
return result;
}
}