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
d4b46a55
Commit
d4b46a55
authored
Nov 01, 2021
by
Ghitha Dinan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
province add get by name
parent
6de26e01
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
ProvinceController.kt
...ng/inovasi/daerah/master/controller/ProvinceController.kt
+5
-0
ProvinceService.kt
...gkuriang/inovasi/daerah/master/service/ProvinceService.kt
+2
-0
ProvinceServiceImpl.kt
...inovasi/daerah/master/service/impl/ProvinceServiceImpl.kt
+12
-0
No files found.
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/ProvinceController.kt
View file @
d4b46a55
...
@@ -32,6 +32,11 @@ class ProvinceController {
...
@@ -32,6 +32,11 @@ class ProvinceController {
return
service
.
getDetail
(
id
)
return
service
.
getDetail
(
id
)
}
}
@GetMapping
(
value
=
[
"get-by-name"
],
produces
=
[
"application/json"
])
fun
getByName
(
@RequestParam
(
"name"
)
name
:
String
):
ResponseEntity
<*>?
{
return
service
.
getByName
(
name
)
}
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
saveData
(
@Valid
@RequestBody
request
:
Province
):
ResponseEntity
<*>?
{
fun
saveData
(
@Valid
@RequestBody
request
:
Province
):
ResponseEntity
<*>?
{
return
service
.
saveData
(
request
)
return
service
.
saveData
(
request
)
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/ProvinceService.kt
View file @
d4b46a55
...
@@ -19,4 +19,6 @@ interface ProvinceService {
...
@@ -19,4 +19,6 @@ interface ProvinceService {
fun
deleteData
(
request
:
DeleteDataRequest
):
ResponseEntity
<*>?
fun
deleteData
(
request
:
DeleteDataRequest
):
ResponseEntity
<*>?
fun
datatable
(
req
:
Pagination2Request
):
ResponseEntity
<*>?
fun
datatable
(
req
:
Pagination2Request
):
ResponseEntity
<*>?
fun
getByName
(
name
:
String
):
ResponseEntity
<*>?
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/impl/ProvinceServiceImpl.kt
View file @
d4b46a55
...
@@ -62,6 +62,18 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -62,6 +62,18 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
getByName
(
name
:
String
):
ResponseEntity
<*>?
{
try
{
val
data
=
repo
.
findByName
(
name
.
trim
())
if
(
data
.
isPresent
)
{
return
responseSuccess
(
data
=
data
)
}
return
responseNotFound
()
}
catch
(
e
:
Exception
)
{
throw
e
}
}
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<*>?
{
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<*>?
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
...
...
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