Skip to content

Commit

Permalink
Merge pull request #90 from YAPP-Github/feature/universial-link
Browse files Browse the repository at this point in the history
[Feature/universial-link] aasa 파일 서빙 기능 추가
  • Loading branch information
devk0ng authored Jan 13, 2024
2 parents cb865d0 + 6875592 commit 0c1e728
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
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": ["*"]
}
]
}
}

0 comments on commit 0c1e728

Please sign in to comment.