Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
I
Inovasi Daerah Master
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ghitha Dinan
Inovasi Daerah Master
Commits
2a5a0a18
Commit
2a5a0a18
authored
Oct 06, 2021
by
Ghitha Dinan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user fixing
parent
cd0fcace
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
Users.kt
...lin/id/co/sangkuriang/inovasi/daerah/master/pojo/Users.kt
+7
-0
Helpers.kt
...d/co/sangkuriang/inovasi/daerah/master/utility/Helpers.kt
+4
-1
No files found.
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/pojo/Users.kt
View file @
2a5a0a18
...
@@ -47,6 +47,10 @@ data class Users(
...
@@ -47,6 +47,10 @@ data class Users(
@JsonIgnore
@JsonIgnore
var
confirmedDate
:
Date
?
=
null
,
var
confirmedDate
:
Date
?
=
null
,
@Column
(
name
=
"logged_in"
)
@JsonIgnore
var
loggedIn
:
Boolean
?
=
false
,
@Column
(
name
=
"created_at"
)
@Column
(
name
=
"created_at"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
createdAt
:
Date
?
=
Date
(),
var
createdAt
:
Date
?
=
Date
(),
...
@@ -55,6 +59,9 @@ data class Users(
...
@@ -55,6 +59,9 @@ data class Users(
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
updatedAt
:
Date
?
=
Date
(),
var
updatedAt
:
Date
?
=
Date
(),
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
lastLogin
:
Date
?
=
Date
(),
@Column
(
name
=
"active"
)
@Column
(
name
=
"active"
)
@JsonIgnore
@JsonIgnore
var
active
:
Boolean
?
=
true
var
active
:
Boolean
?
=
true
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/utility/Helpers.kt
View file @
2a5a0a18
package
id.co.sangkuriang.inovasi.daerah.master.utility
package
id.co.sangkuriang.inovasi.daerah.master.utility
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.UPLOAD_ICON_APPLICATION_CATEGORY_DIR
import
id.co.sangkuriang.inovasi.daerah.master.constant.UPLOAD_ICON_APPLICATION_CATEGORY_DIR
import
id.co.sangkuriang.inovasi.daerah.master.constant.UPLOAD_IMAGE_APPLICATION_CATEGORY_DIR
import
id.co.sangkuriang.inovasi.daerah.master.constant.UPLOAD_IMAGE_APPLICATION_CATEGORY_DIR
...
@@ -19,7 +20,9 @@ import javax.servlet.http.HttpServletRequest
...
@@ -19,7 +20,9 @@ import javax.servlet.http.HttpServletRequest
fun
getUsersLogin
():
Users
?
{
fun
getUsersLogin
():
Users
?
{
return
try
{
return
try
{
val
principal
=
SecurityContextHolder
.
getContext
().
authentication
.
principal
as
Any
val
principal
=
SecurityContextHolder
.
getContext
().
authentication
.
principal
as
Any
ObjectMapper
().
readValue
(
principal
.
toString
(),
Users
::
class
.
java
)
val
objectMapper
=
ObjectMapper
()
objectMapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
)
objectMapper
.
readValue
(
principal
.
toString
(),
Users
::
class
.
java
)
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
null
null
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment