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

[Feature/universial-link] aasa 파일 서빙 기능 추가 #90

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion src/main/java/com/pyonsnalcolor/admin/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.concurrent.ExecutionException;

Expand All @@ -32,6 +37,17 @@ public class AdminController {
@Autowired
private FcmPushService fcmPushService;

// universial link
@GetMapping("/")
public ResponseEntity<String> getAASAData() throws IOException {
Resource resource = new ClassPathResource("apple-app-site-association");
byte[] jsonData = Files.readAllBytes(resource.getFile().toPath());

return ResponseEntity.ok()
.contentType(MediaType.APPLICATION_JSON)
.body(new String(jsonData));
}

// ios 테스트용
@GetMapping("/fcm/test")
public ResponseEntity fcmTest(DeviceTokenRequestDto deviceTokenRequestDto) throws ExecutionException, InterruptedException {
Expand Down Expand Up @@ -60,4 +76,4 @@ public void executePbBatch() {
public ResponseEntity getHealthCheck() {
return new ResponseEntity(HttpStatus.OK);
}
}
}
3 changes: 2 additions & 1 deletion src/main/java/com/pyonsnalcolor/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public WebSecurityCustomizer webSecurityCustomizer() {
.antMatchers( "/resources/**",
"/v3/api-docs/**",
"/swagger-ui/**",
"/health-check"
"/health-check",
"/"
);
}

Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/apple-app-site-association
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"applinks": {
"apps": [],
"details": [
{
"appID": "P7PUGAUP8K.kr.co.yapp.22th.pyonsnalcolor",
"paths": ["*"]
}
]
}
}
Loading