hardcode url to redirect until logic is ready
This commit is contained in:
@@ -6,16 +6,20 @@ import com.safeqr.app.qrcode.dto.RedirectCountResponse;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.reactive.function.client.WebClient;
|
import org.springframework.web.reactive.function.client.WebClient;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class RedirectCountService {
|
public class RedirectCountService {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(RedirectCountService.class);
|
||||||
|
|
||||||
public Mono<RedirectCountResponse> countRedirects(QRCodePayload payload) {
|
public Mono<RedirectCountResponse> countRedirects(QRCodePayload payload) {
|
||||||
String url = payload.getData();
|
String url = payload.getData();
|
||||||
|
logger.info("RedirectCountService: countRedirects: url={}", url);
|
||||||
|
|
||||||
return WebClient.create()
|
return WebClient.create()
|
||||||
.get()
|
.get()
|
||||||
.uri(url)
|
.uri("https://google.com")// replace with url when logic is complete
|
||||||
.exchangeToMono(response -> {
|
.exchangeToMono(response -> {
|
||||||
RedirectCountResponse redirectCountResponse = new RedirectCountResponse();
|
RedirectCountResponse redirectCountResponse = new RedirectCountResponse();
|
||||||
redirectCountResponse.setRedirectCount(response.cookies().size());
|
redirectCountResponse.setRedirectCount(response.cookies().size());
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
spring.application.name=SafeQR-app
|
spring.application.name=SafeQR-app
|
||||||
spring.profiles.active=local
|
spring.profiles.active=local
|
||||||
http.port=${HTTP_PORT}
|
#http.port=${HTTP_PORT}
|
||||||
server.port=${SERVER_PORT}
|
#server.port=${SERVER_PORT}
|
||||||
server.ssl.enabled=true
|
#server.ssl.enabled=true
|
||||||
server.ssl.key-store-type=${SERVER_SSL_KEY_STORE_TYPE}
|
#server.ssl.key-store-type=${SERVER_SSL_KEY_STORE_TYPE}
|
||||||
server.ssl.key-store=${SERVER_SSL_KEY_STORE_LOCATION}
|
#server.ssl.key-store=${SERVER_SSL_KEY_STORE_LOCATION}
|
||||||
server.ssl.key-store-password=${SERVER_SSL_KEY_STORE_PASSWORD}
|
#server.ssl.key-store-password=${SERVER_SSL_KEY_STORE_PASSWORD}
|
||||||
server.ssl.key-alias=${SERVER_SSL_KEY_ALIAS}
|
#server.ssl.key-alias=${SERVER_SSL_KEY_ALIAS}
|
||||||
trust.store=${SERVER_SSL_TRUST_STORE_LOCATION}
|
#trust.store=${SERVER_SSL_TRUST_STORE_LOCATION}
|
||||||
trust.store.password=${SERVER_SSL_TRUST_STORE_PASSWORD}
|
#trust.store.password=${SERVER_SSL_TRUST_STORE_PASSWORD}
|
||||||
|
|
||||||
spring.datasource.url=${SERVER_DB_URL}
|
spring.datasource.url=${SERVER_DB_URL}
|
||||||
spring.datasource.username=${SERVER_DB_USERNAME}
|
spring.datasource.username=${SERVER_DB_USERNAME}
|
||||||
|
|||||||
Reference in New Issue
Block a user