-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24e1d25
commit e0fd5c5
Showing
32 changed files
with
302 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/com/seulseul/seulseul/controller/HelloController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.seulseul.seulseul.controller; | ||
|
||
import com.seulseul.seulseul.entity.ApiKey; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
import java.net.URLEncoder; | ||
|
||
@RestController | ||
public class HelloController { | ||
|
||
private final ApiKey apiService; | ||
|
||
public HelloController(ApiKey apiService) { | ||
this.apiService = apiService; | ||
} | ||
|
||
@GetMapping("/hello") | ||
public String getHello() throws IOException { | ||
String urlInfo = "https://api.odsay.com/v1/api/searchPubTransPathT?SX=126.9027279&SY=37.5349277&EX=126.9145430&EY=37.5499421&apiKey=" + URLEncoder.encode(apiService.getApiKey(), "UTF-8"); | ||
|
||
// http 연결 | ||
URL url = new URL(urlInfo); | ||
HttpURLConnection conn = (HttpURLConnection)url.openConnection(); | ||
conn.setRequestMethod("GET"); | ||
conn.setRequestProperty("Content-type", "application/json"); | ||
|
||
BufferedReader bufferedReader = | ||
new BufferedReader(new InputStreamReader(conn.getInputStream())); | ||
|
||
StringBuilder sb = new StringBuilder(); | ||
String line; | ||
while ((line = bufferedReader.readLine()) != null) { | ||
sb.append(line); | ||
} | ||
bufferedReader.close(); | ||
conn.disconnect(); | ||
|
||
// 결과 출력 | ||
System.out.println(sb.toString()); | ||
return "hello"; | ||
} | ||
|
||
@GetMapping("/test") | ||
public String Test() { | ||
return "test"; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/controller/baseRoute/BaseRouteController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.controller.baseRoute; | ||
|
||
public class BaseRouteController { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/seulseul/seulseul/controller/endPos/EndPosController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.seulseul.seulseul.controller.endPos; | ||
|
||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class EndPosController { | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/seulseul/seulseul/controller/firbase/FcmController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.seulseul.seulseul.controller.firbase;//package com.seulseul.seulseul.controller.firbase; | ||
// | ||
//import com.seulseul.seulseul.dto.firebase.RequestDTO; | ||
//import com.seulseul.seulseul.service.firebase.FirebaseCloudMessageService; | ||
//import lombok.RequiredArgsConstructor; | ||
//import org.springframework.http.ResponseEntity; | ||
//import org.springframework.web.bind.annotation.PostMapping; | ||
//import org.springframework.web.bind.annotation.RequestBody; | ||
//import org.springframework.web.bind.annotation.RestController; | ||
// | ||
//import java.io.IOException; | ||
// | ||
//@RestController | ||
//@RequiredArgsConstructor | ||
//public class FcmController { | ||
// | ||
// private final FirebaseCloudMessageService firebaseCloudMessageService; | ||
// | ||
// @PostMapping("/api/fcm") | ||
// public ResponseEntity pushMessage(@RequestBody RequestDTO requestDTO) throws IOException { | ||
// System.out.println(requestDTO.getTargetToken() + " " | ||
// + requestDTO.getTitle() + " " + requestDTO.getBody()); | ||
// | ||
// firebaseCloudMessageService.sendMessageTo( | ||
// requestDTO.getTargetToken(), | ||
// requestDTO.getTitle(), | ||
// requestDTO.getBody()); | ||
// return ResponseEntity.ok().build(); | ||
// } | ||
// | ||
//} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/seulseul/seulseul/controller/stopTimeList/StopTimeListController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.seulseul.seulseul.controller.stopTimeList; | ||
|
||
public class StopTimeListController { | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/seulseul/seulseul/controller/transferInfo/TransferInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.seulseul.seulseul.controller.transferInfo; | ||
|
||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class TransferInfo { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/seulseul/seulseul/controller/user/UserController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.seulseul.seulseul.controller.user; | ||
|
||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class UserController { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/dto/baseRoute/BaseRouteDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.dto.baseRoute; | ||
|
||
public class BaseRouteDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/dto/endPos/EndPosDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.dto.endPos; | ||
|
||
public class EndPosDto { | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/seulseul/seulseul/dto/firebase/RequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.seulseul.seulseul.dto.firebase; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@AllArgsConstructor | ||
@Data | ||
public class RequestDto { | ||
private String title; | ||
private String body; | ||
private String targetToken; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/dto/stopTimeList/StopTimeDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.dto.stopTimeList; | ||
|
||
public class StopTimeDto { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/dto/transferInfo/TransferInfoDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.dto.transferInfo; | ||
|
||
public class TransferInfoDto { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.dto.user; | ||
|
||
public class UserDto { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.seulseul.seulseul.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.PropertySource; | ||
import org.springframework.stereotype.Component; | ||
|
||
; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
@Getter | ||
@PropertySource(value = "classpath:application-API-KEY.properties") | ||
public class ApiKey { | ||
@Value("${ODSAY-API-KEY}") | ||
private String apiKey; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/entity/baseRoute/BaseRoute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.entity.baseRoute; | ||
|
||
public class BaseRoute { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/entity/endPos/EndPos.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.entity.endPos; | ||
|
||
public class EndPos { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/entity/stopTimeList/StopTimeList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.entity.stopTimeList; | ||
|
||
public class StopTimeList { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/entity/transferInfo/TransferInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.entity.transferInfo; | ||
|
||
public class TransferInfo { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.entity.user; | ||
|
||
public class User { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/repository/baseRoute/BaseRouteRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.repository.baseRoute; | ||
|
||
public interface BaseRouteRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/repository/endPos/EndPosRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.repository.endPos; | ||
|
||
public interface EndPosRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/repository/stopTimeList/StopTimeListRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.repository.stopTimeList; | ||
|
||
public interface StopTimeListRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/repository/transferInfo/TransferInfoRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.repository.transferInfo; | ||
|
||
public interface TransferInfoRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/repository/user/UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.repository.user; | ||
|
||
public interface UserRepository { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/seulseul/seulseul/service/baseRoute/BaseRouteService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.seulseul.seulseul.service.baseRoute; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class BaseRouteService { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/service/endPos/EndPosService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.service.endPos; | ||
|
||
public class EndPosService { | ||
} |
65 changes: 65 additions & 0 deletions
65
src/main/java/com/seulseul/seulseul/service/firebase/FirebaseCloudMessageService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.seulseul.seulseul.service.firebase;//package com.seulseul.seulseul.service.firebase; | ||
// | ||
//import com.fasterxml.jackson.databind.ObjectMapper; | ||
//import lombok.RequiredArgsConstructor; | ||
//import org.apache.coyote.Response; | ||
//import org.springframework.stereotype.Component; | ||
//import org.springframework.web.bind.annotation.RequestBody; | ||
// | ||
//import java.io.IOException; | ||
// | ||
//@Component | ||
//@RequiredArgsConstructor | ||
//public class FirebaseCloudMessageService { | ||
// | ||
// private final String API_URL = "https://fcm.googleapis.com/v1/projects/본인 프로젝트 ID/messages:send"; | ||
// private final ObjectMapper objectMapper; | ||
// | ||
// public void sendMessageTo(String targetToken, String title, String body) throws IOException { | ||
// String message = makeMessage(targetToken, title, body); | ||
// | ||
// OkHttpClient client = new OkHttpClient(); | ||
// RequestBody requestBody = RequestBody.create(message, MediaType.get("application/json; charset=utf-8")); | ||
// Request request = new Request.Builder() | ||
// .url(API_URL) | ||
// .post(requestBody) | ||
// .addHeader(HttpHeaders.AUTHORIZATION, "Bearer " + getAccessToken()) | ||
// .addHeader(HttpHeaders.CONTENT_TYPE, "application/json; UTF-8") | ||
// .build(); | ||
// | ||
// Response response = client.newCall(request) | ||
// .execute(); | ||
// | ||
// System.out.println(response.body().string()); | ||
// } | ||
// | ||
// private String makeMessage(String targetToken, String title, String body) throws JsonProcessingException { | ||
// FcmMessage fcmMessage = FcmMessage.builder() | ||
// .message(FcmMessage.Message.builder() | ||
// .token(targetToken) | ||
// .notification(FcmMessage.Notification.builder() | ||
// .title(title) | ||
// .body(body) | ||
// .image(null) | ||
// .build() | ||
// ) | ||
// .build() | ||
// ) | ||
// .validate_only(false) | ||
// .build(); | ||
// | ||
// return objectMapper.writeValueAsString(fcmMessage); | ||
// } | ||
// | ||
// private String getAccessToken() throws IOException { | ||
// String firebaseConfigPath = "/firebase/다운 받은 비공개키.json"; | ||
// | ||
// GoogleCredentials googleCredentials = GoogleCredentials | ||
// .fromStream(new ClassPathResource(firebaseConfigPath).getInputStream()) | ||
// .createScoped(List.of("https://www.googleapis.com/auth/cloud-platform")); | ||
// | ||
// googleCredentials.refreshIfExpired(); | ||
// return googleCredentials.getAccessToken().getTokenValue(); | ||
// } | ||
// | ||
//} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/service/stopTimeList/StopTimeListService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.service.stopTimeList; | ||
|
||
public class StopTimeListService { | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/seulseul/seulseul/service/transferInfo/TransferInfoService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.seulseul.seulseul.service.transferInfo; | ||
|
||
public class TransferInfoService { | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/seulseul/seulseul/service/user/UserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.seulseul.seulseul.service.user; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class UserService { | ||
} |