mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:06:50 +00:00
feature/added timeStamp for UserAuthContext endpoints
This commit is contained in:
parent
47c79a8b73
commit
caadf5d069
@ -3494,7 +3494,8 @@ object SwaggerDefinitionsJSON {
|
||||
user_auth_context_id = "613c83ea-80f9-4560-8404-b9cd4ec42a7f",
|
||||
user_id = ExampleValue.userIdExample.value,
|
||||
key = "CUSTOMER_NUMBER",
|
||||
value = "78987432"
|
||||
value = "78987432",
|
||||
timeStamp = parseDate(timeStampExample.value).getOrElse(sys.error("timeStampExample.value is not validate date format."))
|
||||
)
|
||||
|
||||
val userAuthContextUpdateJson = UserAuthContextUpdateJson(
|
||||
|
||||
@ -136,9 +136,9 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{
|
||||
// (Else caching is invalidated by constantly changing date)
|
||||
|
||||
val DateWithDayExampleObject = DateWithDayFormat.parse(DateWithDayExampleString)
|
||||
val DateWithSecondsExampleObject = DateWithDayFormat.parse(DateWithSecondsExampleString)
|
||||
val DateWithMsExampleObject = DateWithDayFormat.parse(DateWithMsExampleString)
|
||||
val DateWithMsRollbackExampleObject = DateWithDayFormat.parse(DateWithMsRollbackExampleString)
|
||||
val DateWithSecondsExampleObject = DateWithSecondsFormat.parse(DateWithSecondsExampleString)
|
||||
val DateWithMsExampleObject = DateWithMsFormat.parse(DateWithMsExampleString)
|
||||
val DateWithMsRollbackExampleObject = DateWithMsRollbackFormat.parse(DateWithMsRollbackExampleString)
|
||||
|
||||
private def oneYearAgo(toDate: Date): Date = {
|
||||
val oneYearAgo = Calendar.getInstance
|
||||
|
||||
@ -11,6 +11,7 @@ import net.liftweb.json.JsonAST.JValue
|
||||
import net.liftweb.json.{TypeInfo, _}
|
||||
import org.apache.commons.lang3.StringUtils
|
||||
|
||||
import java.text.SimpleDateFormat
|
||||
import scala.collection.immutable.List
|
||||
import scala.reflect.runtime.universe
|
||||
import scala.reflect.runtime.universe._
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package code.api.util
|
||||
|
||||
|
||||
import code.api.util.APIUtil.parseDate
|
||||
import code.api.util.APIUtil.{DateWithMs, DateWithMsExampleString, parseDate}
|
||||
import code.api.util.ErrorMessages.{InvalidJsonFormat, UnknownError, UserHasMissingRoles, UserNotLoggedIn}
|
||||
import net.liftweb.json.JsonDSL._
|
||||
import code.api.util.Glossary.{glossaryItems, makeGlossaryItem}
|
||||
@ -265,6 +265,7 @@ object ExampleValue {
|
||||
|
||||
lazy val dateExample = ConnectorField("2020-01-27", "The Date in the format: yyyy-MM-dd")
|
||||
lazy val dateTimeExample = ConnectorField("2021-04-08T09:12:27Z", "The Date in the format: yyyy-MM-dd'T'HH:mm:ss'Z'")
|
||||
lazy val timeStampExample = ConnectorField(DateWithMsExampleString, s"The TimeStamp in the format: $DateWithMs")
|
||||
lazy val cancelledDateExample = ConnectorField("2020-01-27", "The Cancelled Date in the format: yyyy-MM-dd")
|
||||
lazy val dateCancelledExample = cancelledDateExample
|
||||
lazy val signedDateExample = ConnectorField("2020-01-27", "The Signed Date in the format: yyyy-MM-dd")
|
||||
|
||||
@ -304,7 +304,8 @@ case class UserAuthContextJson(
|
||||
user_auth_context_id: String,
|
||||
user_id: String,
|
||||
key: String,
|
||||
value: String
|
||||
value: String,
|
||||
timeStamp: Date
|
||||
)
|
||||
case class UserAuthContextUpdateJson(
|
||||
user_auth_context_update_id: String,
|
||||
@ -992,7 +993,8 @@ object JSONFactory310{
|
||||
user_auth_context_id= userAuthContext.userAuthContextId,
|
||||
user_id = userAuthContext.userId,
|
||||
key = userAuthContext.key,
|
||||
value = userAuthContext.value
|
||||
value = userAuthContext.value,
|
||||
timeStamp = userAuthContext.timeStamp
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -4471,7 +4471,8 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
|
||||
data= UserAuthContextCommons(userAuthContextId=userAuthContextIdExample.value,
|
||||
userId=userIdExample.value,
|
||||
key=keyExample.value,
|
||||
value=valueExample.value))
|
||||
value=valueExample.value,
|
||||
timeStamp=parseDate(timeStampExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format."))))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
@ -4585,7 +4586,9 @@ object AkkaConnector_vDec2018 extends Connector with AkkaConnectorActorInit {
|
||||
data=List( UserAuthContextCommons(userAuthContextId=userAuthContextIdExample.value,
|
||||
userId=userIdExample.value,
|
||||
key=keyExample.value,
|
||||
value=valueExample.value)))
|
||||
value=valueExample.value,
|
||||
timeStamp=parseDate(timeStampExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")),
|
||||
)))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
|
||||
@ -4661,7 +4661,8 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
|
||||
data= UserAuthContextCommons(userAuthContextId=userAuthContextIdExample.value,
|
||||
userId=userIdExample.value,
|
||||
key=keyExample.value,
|
||||
value=valueExample.value))
|
||||
value=valueExample.value,
|
||||
timeStamp=parseDate(timeStampExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format."))))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
@ -4775,7 +4776,8 @@ trait RestConnector_vMar2019 extends Connector with KafkaHelper with MdcLoggable
|
||||
data=List( UserAuthContextCommons(userAuthContextId=userAuthContextIdExample.value,
|
||||
userId=userIdExample.value,
|
||||
key=keyExample.value,
|
||||
value=valueExample.value)))
|
||||
value=valueExample.value,
|
||||
timeStamp=parseDate(timeStampExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
|
||||
@ -4639,7 +4639,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
data= UserAuthContextCommons(userAuthContextId=userAuthContextIdExample.value,
|
||||
userId=userIdExample.value,
|
||||
key=keyExample.value,
|
||||
value=valueExample.value))
|
||||
value=valueExample.value,
|
||||
timeStamp=parseDate(timeStampExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format."))))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
@ -4753,7 +4754,8 @@ trait StoredProcedureConnector_vDec2019 extends Connector with MdcLoggable {
|
||||
data=List( UserAuthContextCommons(userAuthContextId=userAuthContextIdExample.value,
|
||||
userId=userIdExample.value,
|
||||
key=keyExample.value,
|
||||
value=valueExample.value)))
|
||||
value=valueExample.value,
|
||||
timeStamp=parseDate(timeStampExample.value).getOrElse(sys.error("dateOfBirthExample.value is not validate date format.")))))
|
||||
),
|
||||
adapterImplementation = Some(AdapterImplementation("- Core", 1))
|
||||
)
|
||||
|
||||
@ -17,6 +17,7 @@ class MappedUserAuthContext extends UserAuthContext with LongKeyedMapper[MappedU
|
||||
override def key = mKey.get
|
||||
override def value = mValue.get
|
||||
override def userAuthContextId = mUserAuthContextId.get
|
||||
override def timeStamp = createdAt.get
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,8 @@ case class UserAuthContextCommons(
|
||||
userAuthContextId :String,
|
||||
userId :String,
|
||||
key :String,
|
||||
value :String) extends UserAuthContext
|
||||
value :String,
|
||||
timeStamp :Date) extends UserAuthContext
|
||||
|
||||
object UserAuthContextCommons extends Converter[UserAuthContext, UserAuthContextCommons]
|
||||
|
||||
|
||||
@ -298,6 +298,7 @@ trait UserAuthContext {
|
||||
def userId : String
|
||||
def key : String
|
||||
def value : String
|
||||
def timeStamp : Date
|
||||
}
|
||||
|
||||
trait ConsentAuthContext {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user