diff --git a/src/main/java/com/kri/intranet/extension/controller/ShortUrlController.java b/src/main/java/com/kri/intranet/extension/controller/ShortUrlController.java deleted file mode 100644 index 23faac2..0000000 --- a/src/main/java/com/kri/intranet/extension/controller/ShortUrlController.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.kri.intranet.extension.controller; - -import io.swagger.v3.oas.annotations.tags.Tag; -import java.net.URI; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.util.MultiValueMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.util.UriComponentsBuilder; - -@RestController -@RequestMapping("/api/v1/short-url") -@RequiredArgsConstructor -@Tag(name = "ShortUrl", description = "단축 URL API") -public class ShortUrlController { - - @GetMapping("/redirect/{shortKey}") - public ResponseEntity redirectShortUrl( - @PathVariable String shortKey, - @RequestParam MultiValueMap params - ) { - //String targetUrl = shortUrlService.findTargetUrl(shortKey); - String targetUrl = "https://kon.kric.com/project/2606002_A/INDEX.asp"; - - if (!targetUrl.startsWith("http://") && !targetUrl.startsWith("https://")) { - targetUrl = "https://" + targetUrl; - } - - UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(targetUrl); - - params.forEach((key, values) -> { - for (String value : values) { - builder.queryParam(key, value); - } - }); - - URI redirectUri = builder.build(true).toUri(); - - return ResponseEntity - .status(HttpStatus.FOUND) - .location(redirectUri) - .build(); - } - -} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 83d6e80..d198791 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,4 +3,14 @@ spring: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver url: jdbc:sqlserver://10.10.11.6:1433;databaseName=project2;encrypt=false username: sa - password: krco#51304 \ No newline at end of file + password: krco#51304 + +# apikey 보관 DB(MySQL) +kri: + auth: + apikey: + db: + url: jdbc:mysql://db-md87m.vpc-cdb.ntruss.com:3306/kri_common?characterEncoding=UTF-8 + username: kriit + password: it#51304 + driver-class-name: com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 6ce9e4d..688219c 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -8,4 +8,14 @@ spring: mybatis: configuration: map-underscore-to-camel-case: true - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +# apikey 보관 DB(MySQL) +kri: + auth: + apikey: + db: + url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/kri_common?characterEncoding=UTF-8 + username: kriit + password: it#51304 + driver-class-name: com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index ce521bd..a02ac6c 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -3,4 +3,14 @@ spring: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver url: jdbc:sqlserver://1.235.195.34:1433;databaseName=project2;encrypt=false username: sa - password: krco#51304 \ No newline at end of file + password: krco#51304 + +# apikey 보관 DB(MySQL) +kri: + auth: + apikey: + db: + url: jdbc:mysql://db-md87m.vpc-cdb.ntruss.com:3306/kri_common?characterEncoding=UTF-8 + username: kriit + password: it#51304 + driver-class-name: com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3ec464e..fb6508d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -31,12 +31,6 @@ kri: admin-api-enabled: true admin-allow-ips: - 211.254.145.130/32 - # apikey 보관 DB(MySQL) - db: - url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/kri_common?characterEncoding=UTF-8 - username: kriit - password: it#51304 - driver-class-name: com.mysql.cj.jdbc.Driver security: enabled: true @@ -46,7 +40,6 @@ kri: - /swagger-ui/** - /ping - /internal/apikey/** - #- /api/v1/short-url/redirect/** swagger: enabled: true