Commit e87d4cbf authored by Ghitha Dinan's avatar Ghitha Dinan

exception fixing

parent bf70df43
...@@ -2,9 +2,9 @@ package id.co.sangkuriang.inovasi.daerah.master.constant ...@@ -2,9 +2,9 @@ package id.co.sangkuriang.inovasi.daerah.master.constant
import java.io.File import java.io.File
//const val ROOT_DIR = "D:\\app-files\\inovasi_daerah_master\\files\\" const val ROOT_DIR = "D:\\app-files\\inovasi_daerah_master\\files\\"
//const val ROOT_DIR = "/home/inovasi-daerah/data/files/inovasi_daerah_master/" //const val ROOT_DIR = "/home/inovasi-daerah/data/files/inovasi_daerah_master/"
const val ROOT_DIR = "/home/inovasi-daerah-prod/data/files/inovasi_daerah_master/" //const val ROOT_DIR = "/home/inovasi-daerah-prod/data/files/inovasi_daerah_master/"
val UPLOAD_DIR = "${ROOT_DIR}uploads${File.separator}" val UPLOAD_DIR = "${ROOT_DIR}uploads${File.separator}"
val UPLOAD_ICON_APPLICATION_CATEGORY_DIR = "${UPLOAD_DIR}apllication_category/icon" val UPLOAD_ICON_APPLICATION_CATEGORY_DIR = "${UPLOAD_DIR}apllication_category/icon"
......
...@@ -2,10 +2,10 @@ package id.co.sangkuriang.inovasi.daerah.master.constant ...@@ -2,10 +2,10 @@ package id.co.sangkuriang.inovasi.daerah.master.constant
const val TOKEN_PREFIX = "Bearer " const val TOKEN_PREFIX = "Bearer "
const val HEADER_STRING = "Authorization" const val HEADER_STRING = "Authorization"
//const val AUTH_URL = "http://localhost:8081/auth" const val AUTH_URL = "http://localhost:8081/auth"
//const val AUTH_URL = "https://auth.inovasi-daerah.dev.layanan.go.id/auth" //const val AUTH_URL = "https://auth.inovasi-daerah.dev.layanan.go.id/auth"
//const val AUTH_URL = "http://inovasi-daerah-auth.inovasi-daerah.svc.cluster.local:8081/auth" //const val AUTH_URL = "http://inovasi-daerah-auth.inovasi-daerah.svc.cluster.local:8081/auth"
const val AUTH_URL = "http://inovasi-daerah-auth-prod.inovasi-daerah-prod.svc.cluster.local:8081/auth" //const val AUTH_URL = "http://inovasi-daerah-auth-prod.inovasi-daerah-prod.svc.cluster.local:8081/auth"
val USER_ALLOWED_PATH = emptyList<String>() val USER_ALLOWED_PATH = emptyList<String>()
......
package id.co.sangkuriang.inovasi.daerah.master.constant
//const val APPLICATION_URL = "http://inovasi-daerah-application.inovasi-daerah.svc.cluster.local:8082"
const val APPLICATION_URL = "https://application.inovasi-daerah.dev.layanan.go.id"
...@@ -2,6 +2,7 @@ package id.co.sangkuriang.inovasi.daerah.master.helpers ...@@ -2,6 +2,7 @@ package id.co.sangkuriang.inovasi.daerah.master.helpers
import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.ObjectMapper
import id.co.sangkuriang.inovasi.daerah.master.constant.APPLICATION_URL
import id.co.sangkuriang.inovasi.daerah.master.constant.HEADER_STRING import id.co.sangkuriang.inovasi.daerah.master.constant.HEADER_STRING
import id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData import id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import kong.unirest.Unirest import kong.unirest.Unirest
...@@ -51,5 +52,25 @@ class RequestHelpers { ...@@ -51,5 +52,25 @@ class RequestHelpers {
null null
} }
} }
fun applicationCountByParam(bearer: String?, param: String?, paramId: String?): ReturnData? {
return try {
configHttpClient()
val objectMapper = ObjectMapper()
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
val reqUrl =
"$APPLICATION_URL/application/count-by-param?param=$param&paramId=$paramId"
val response = Unirest.get(reqUrl)
.header("Content-Type", "application/json")
.header(HEADER_STRING, bearer)
.asString()
objectMapper.readValue(response.body, ReturnData::class.java)
} catch (e: Exception) {
e.printStackTrace()
null
}
}
} }
} }
...@@ -5,9 +5,9 @@ server.port=8080 ...@@ -5,9 +5,9 @@ server.port=8080
# DATABASE CONFIG # DATABASE CONFIG
# local # local
#spring.datasource.url=jdbc:postgresql://localhost:5432/inovasi_daerah_backup spring.datasource.url=jdbc:postgresql://localhost:5432/inovasi_daerah_backup
#spring.datasource.username=postgres spring.datasource.username=postgres
#spring.datasource.password=root spring.datasource.password=root
# dev # dev
#spring.datasource.url=jdbc:postgresql://pg-dev.spbe.sangkuriang.co.id:5432/inovasi_daerah_db #spring.datasource.url=jdbc:postgresql://pg-dev.spbe.sangkuriang.co.id:5432/inovasi_daerah_db
...@@ -15,9 +15,9 @@ server.port=8080 ...@@ -15,9 +15,9 @@ server.port=8080
#spring.datasource.password=wV9Tnx6S8TmmUYXdgkmN4pzreSD3RE #spring.datasource.password=wV9Tnx6S8TmmUYXdgkmN4pzreSD3RE
# prod # prod
spring.datasource.url=jdbc:postgresql://pg.spbe-prd.sangkuriang.co.id:5432/inovasi_daerah_db #spring.datasource.url=jdbc:postgresql://pg.spbe-prd.sangkuriang.co.id:5432/inovasi_daerah_db
spring.datasource.username=u_inovasi_daerah #spring.datasource.username=u_inovasi_daerah
spring.datasource.password=wV9Tnx6S8TmmUYXdgkmN4pzreSD3RE #spring.datasource.password=wV9Tnx6S8TmmUYXdgkmN4pzreSD3RE
spring.jpa.hibernate.ddl-auto=none spring.jpa.hibernate.ddl-auto=none
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<!-- configuration file for LogBack (slf4J implementation) <!-- configuration file for LogBack (slf4J implementation)
See here for more details: http://gordondickens.com/wordpress/2013/03/27/sawing-through-the-java-loggers/ --> See here for more details: http://gordondickens.com/wordpress/2013/03/27/sawing-through-the-java-loggers/ -->
<configuration scan="true" scanPeriod="30 seconds"> <configuration scan="true" scanPeriod="30 seconds">
<!-- <property name="DEV_HOME" value="D://app-files//inovasi_daerah_master//log"/>--> <property name="DEV_HOME" value="D://app-files//inovasi_daerah_master//log"/>
<!-- <property name="DEV_HOME" value="/home/inovasi-daerah/data/log/inovasi_daerah_master"/>--> <!-- <property name="DEV_HOME" value="/home/inovasi-daerah/data/log/inovasi_daerah_master"/>-->
<property name="DEV_HOME" value="/home/inovasi-daerah-prod/data/log/inovasi_daerah_master"/> <!-- <property name="DEV_HOME" value="/home/inovasi-daerah-prod/data/log/inovasi_daerah_master"/>-->
<appender name="ACCESS-LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="ACCESS-LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${DEV_HOME}/access.log</file> <file>${DEV_HOME}/access.log</file>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment