Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-form
Commits
d95f1838
Unverified
Commit
d95f1838
authored
2 years ago
by
sarojsingh2021
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #10 from UPHRH-platform/delete-form
Delete form
parents
eafda528
4ea5f1ed
master
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/com/tarento/formservice/controllers/FormsController.java
+1
-1
.../com/tarento/formservice/controllers/FormsController.java
src/main/java/com/tarento/formservice/model/Status.java
+2
-1
src/main/java/com/tarento/formservice/model/Status.java
src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java
+2
-1
...om/tarento/formservice/service/impl/FormsServiceImpl.java
with
5 additions
and
3 deletions
+5
-3
src/main/java/com/tarento/formservice/controllers/FormsController.java
+
1
−
1
View file @
d95f1838
...
...
@@ -78,7 +78,7 @@ public class FormsController {
}
return
ResponseGenerator
.
successResponse
(
formsService
.
getFormById
(
formId
));
}
@PostMapping
(
value
=
PathRoutes
.
FormServiceApi
.
CREATE_FORM
)
public
String
createForm
(
@RequestBody
FormDetail
form
,
@RequestHeader
(
value
=
Constants
.
Parameters
.
X_USER_INFO
,
required
=
false
)
String
xUserInfo
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/model/Status.java
+
2
−
1
View file @
d95f1838
...
...
@@ -4,7 +4,8 @@ import com.fasterxml.jackson.annotation.JsonValue;
public
enum
Status
{
DRAFT
(
"Draft"
),
NEW
(
"New"
),
REVIEW
(
"Review"
),
PUBLISH
(
"Publish"
),
UNPUBLISH
(
"Unpublish"
),
INSCOMPLETED
(
"INSCOMPLETED"
),
LEADINSCOMPLETED
(
"LEADINSCOMPLETED"
),
SENTFORINS
(
"SENTFORINS"
);
"INSCOMPLETED"
),
LEADINSCOMPLETED
(
"LEADINSCOMPLETED"
),
SENTFORINS
(
"SENTFORINS"
),
DELETED
(
"Deleted"
),
DUPLICATE
(
"Duplicate"
);
private
String
value
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/formservice/service/impl/FormsServiceImpl.java
+
2
−
1
View file @
d95f1838
...
...
@@ -286,13 +286,14 @@ public class FormsServiceImpl implements FormsService {
}
else
{
boolQuery
.
must
(
QueryBuilders
.
matchPhraseQuery
(
Constants
.
STATUS
,
Status
.
PUBLISH
.
name
()));
}
boolQuery
.
mustNot
(
QueryBuilders
.
matchPhraseQuery
(
Constants
.
STATUS
,
Status
.
DELETED
.
name
()));
return
boolQuery
;
}
private
SearchRequest
buildQueryForGetQueryById
(
Long
id
)
{
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
().
size
(
0
)
.
query
(
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
matchQuery
(
"id"
,
id
)))
.
query
(
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
matchQuery
(
"id"
,
id
))
.
mustNot
(
QueryBuilders
.
matchPhraseQuery
(
Constants
.
STATUS
,
Status
.
DELETED
.
name
()))
)
.
aggregation
(
AggregationBuilders
.
terms
(
"UniqueFormId"
).
field
(
"id"
).
size
(
100
)
.
subAggregation
(
AggregationBuilders
.
topHits
(
"LatestVersion"
).
from
(
0
).
size
(
1
)
.
version
(
Boolean
.
FALSE
).
explain
(
Boolean
.
FALSE
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets