Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jh-boot
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jan Hrabal
jh-boot
Commits
9390b626
Commit
9390b626
authored
Nov 12, 2019
by
Jan Hrabal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erorrs
parent
7f98b693
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
9 deletions
+50
-9
createdb.sql
sql/createdb.sql
+6
-0
init.sql
sql/init.sql
+0
-9
ErrorMessage.java
src/main/java/com/jh/boot/web/error/ErrorMessage.java
+44
-0
No files found.
sql/createdb.sql
0 → 100644
View file @
9390b626
CREATE
DATABASE
suite
WITH
OWNER
=
postgres
ENCODING
=
'utf8'
TABLESPACE
=
pg_default
CONNECTION
LIMIT
=
-
1
;
sql/init.sql
View file @
9390b626
CREATE
DATABASE
suite
WITH
OWNER
=
postgres
ENCODING
=
'utf8'
TABLESPACE
=
pg_default
CONNECTION
LIMIT
=
-
1
;
--
CREATE
SEQUENCE
ID_GENERATOR
;
-- version procedure
...
...
src/main/java/com/jh/boot/web/error/ErrorMessage.java
View file @
9390b626
...
...
@@ -19,6 +19,7 @@ public class ErrorMessage {
@JsonProperty
(
"msg"
)
private
String
message
;
private
Object
payload
;
/**
* Instantiates a new error message.
...
...
@@ -90,6 +91,44 @@ public class ErrorMessage {
return
em
;
}
public
static
ErrorMessage
withCodePayload
(
String
code
,
Object
payload
)
{
ErrorMessage
em
=
new
ErrorMessage
();
em
.
code
=
code
;
em
.
payload
=
payload
;
return
em
;
}
public
static
ErrorMessage
withFieldCodePayload
(
String
field
,
String
code
,
Object
payload
)
{
ErrorMessage
em
=
new
ErrorMessage
();
em
.
field
=
field
;
em
.
code
=
code
;
em
.
payload
=
payload
;
return
em
;
}
public
static
ErrorMessage
withFieldCodeMessagePayload
(
String
field
,
String
code
,
String
message
,
Object
payload
)
{
ErrorMessage
em
=
new
ErrorMessage
();
em
.
field
=
field
;
em
.
code
=
code
;
em
.
payload
=
payload
;
em
.
message
=
message
;
return
em
;
}
public
static
ErrorMessage
withMessagePayload
(
String
message
,
Object
payload
)
{
ErrorMessage
em
=
new
ErrorMessage
();
em
.
payload
=
payload
;
em
.
message
=
message
;
return
em
;
}
public
static
ErrorMessage
withFieldMessagePayload
(
String
field
,
String
message
,
Object
payload
)
{
ErrorMessage
em
=
new
ErrorMessage
();
em
.
field
=
field
;
em
.
payload
=
payload
;
em
.
message
=
message
;
return
em
;
}
/**
* With message.
...
...
@@ -145,4 +184,8 @@ public class ErrorMessage {
public
String
getMessage
()
{
return
message
;
}
public
Object
getPayload
()
{
return
payload
;
}
}
\ No newline at end of file
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