Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PMRMS Auth
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
PMRMS Auth
Commits
40e15017
Commit
40e15017
authored
Jan 10, 2022
by
Ghitha Dinan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add role user
parent
65c9aade
Pipeline
#399
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
4 deletions
+77
-4
Role.kt
...ain/kotlin/id/go/kemenag/madrasah/pmrms/auth/pojo/Role.kt
+35
-0
Users.kt
...in/kotlin/id/go/kemenag/madrasah/pmrms/auth/pojo/Users.kt
+6
-4
UsersRole.kt
...otlin/id/go/kemenag/madrasah/pmrms/auth/pojo/UsersRole.kt
+36
-0
No files found.
src/main/kotlin/id/go/kemenag/madrasah/pmrms/auth/pojo/Role.kt
0 → 100644
View file @
40e15017
package
id.go.kemenag.madrasah.pmrms.auth.pojo
import
com.fasterxml.jackson.annotation.JsonFormat
import
com.fasterxml.jackson.annotation.JsonIgnore
import
id.go.kemenag.madrasah.pmrms.auth.constant.VALIDATOR_MSG_REQUIRED
import
java.util.*
import
javax.persistence.Column
import
javax.persistence.Entity
import
javax.persistence.Id
import
javax.persistence.Table
import
javax.validation.constraints.NotEmpty
@Entity
@Table
(
name
=
"role"
,
schema
=
"auth"
)
data class
Role
(
@Id
@Column
(
name
=
"id"
)
var
id
:
String
?
=
UUID
.
randomUUID
().
toString
(),
@Column
(
name
=
"name"
)
@field
:
NotEmpty
(
message
=
"Nama $VALIDATOR_MSG_REQUIRED"
)
var
name
:
String
?
=
null
,
@Column
(
name
=
"created_at"
)
@get
:
JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
createdAt
:
Date
?
=
Date
(),
@Column
(
name
=
"updated_at"
)
@get
:
JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
updatedAt
:
Date
?
=
Date
(),
@Column
(
name
=
"active"
)
@JsonIgnore
var
active
:
Boolean
?
=
true
)
src/main/kotlin/id/go/kemenag/madrasah/pmrms/auth/pojo/Users.kt
View file @
40e15017
...
@@ -2,11 +2,9 @@ package id.go.kemenag.madrasah.pmrms.auth.pojo
...
@@ -2,11 +2,9 @@ package id.go.kemenag.madrasah.pmrms.auth.pojo
import
com.fasterxml.jackson.annotation.JsonFormat
import
com.fasterxml.jackson.annotation.JsonFormat
import
com.fasterxml.jackson.annotation.JsonIgnore
import
com.fasterxml.jackson.annotation.JsonIgnore
import
org.hibernate.annotations.Where
import
java.util.*
import
java.util.*
import
javax.persistence.Column
import
javax.persistence.*
import
javax.persistence.Entity
import
javax.persistence.Id
import
javax.persistence.Table
@Entity
@Entity
@Table
(
name
=
"users"
,
schema
=
"auth"
)
@Table
(
name
=
"users"
,
schema
=
"auth"
)
...
@@ -28,6 +26,10 @@ data class Users(
...
@@ -28,6 +26,10 @@ data class Users(
@Column
(
name
=
"last_name"
)
@Column
(
name
=
"last_name"
)
var
lastName
:
String
?
=
null
,
var
lastName
:
String
?
=
null
,
@OneToMany
(
mappedBy
=
"userId"
)
@Where
(
clause
=
"active = true"
)
var
roles
:
MutableSet
<
UsersRole
>?
=
null
,
@Column
(
name
=
"created_at"
)
@Column
(
name
=
"created_at"
)
@get
:
JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
@get
:
JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
createdAt
:
Date
?
=
Date
(),
var
createdAt
:
Date
?
=
Date
(),
...
...
src/main/kotlin/id/go/kemenag/madrasah/pmrms/auth/pojo/UsersRole.kt
0 → 100644
View file @
40e15017
package
id.go.kemenag.madrasah.pmrms.auth.pojo
import
com.fasterxml.jackson.annotation.JsonFormat
import
com.fasterxml.jackson.annotation.JsonIgnore
import
java.util.*
import
javax.persistence.*
@Entity
@Table
(
name
=
"users_role"
,
schema
=
"auth"
)
data class
UsersRole
(
@Id
@Column
(
name
=
"id"
)
var
id
:
String
?
=
UUID
.
randomUUID
().
toString
(),
@Column
(
name
=
"user_id"
)
var
userId
:
String
?
=
null
,
@Column
(
name
=
"role_id"
)
var
roleId
:
String
?
=
null
,
@ManyToOne
@JoinColumn
(
name
=
"role_id"
,
insertable
=
false
,
updatable
=
false
,
nullable
=
true
)
var
role
:
Role
?
=
null
,
@Column
(
name
=
"created_at"
)
@get
:
JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
createdAt
:
Date
?
=
Date
(),
@Column
(
name
=
"updated_at"
)
@get
:
JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"dd-MM-yyyy HH:mm:ss"
,
timezone
=
"GMT+7"
)
var
updatedAt
:
Date
?
=
Date
(),
@Column
(
name
=
"active"
)
@JsonIgnore
var
active
:
Boolean
?
=
true
)
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