260612_01_ENH: 단축 url 기능 제거 및 api 확인용 db 정보 이관
This commit is contained in:
@@ -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<Void> redirectShortUrl(
|
||||
@PathVariable String shortKey,
|
||||
@RequestParam MultiValueMap<String, String> 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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
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
|
||||
@@ -8,4 +8,14 @@ spring:
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
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
|
||||
@@ -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
|
||||
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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user