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
13516436
Commit
13516436
authored
Jan 06, 2022
by
Ghitha Dinan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add swagger
parent
790e31b3
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
107 additions
and
88 deletions
+107
-88
ApplicationCategoryController.kt
...daerah/master/controller/ApplicationCategoryController.kt
+6
-5
ProvinceController.kt
...ng/inovasi/daerah/master/controller/ProvinceController.kt
+7
-6
PublicController.kt
...iang/inovasi/daerah/master/controller/PublicController.kt
+8
-7
RegencyController.kt
...ang/inovasi/daerah/master/controller/RegencyController.kt
+6
-5
TagController.kt
...kuriang/inovasi/daerah/master/controller/TagController.kt
+6
-5
Response.kt
.../co/sangkuriang/inovasi/daerah/master/helpers/Response.kt
+18
-12
ApplicationCategoryService.kt
...ovasi/daerah/master/service/ApplicationCategoryService.kt
+8
-6
ProvinceService.kt
...gkuriang/inovasi/daerah/master/service/ProvinceService.kt
+9
-8
RegencyService.kt
...ngkuriang/inovasi/daerah/master/service/RegencyService.kt
+6
-5
TagService.kt
...o/sangkuriang/inovasi/daerah/master/service/TagService.kt
+6
-5
ApplicationCategoryServiceImpl.kt
...rah/master/service/impl/ApplicationCategoryServiceImpl.kt
+6
-6
ProvinceServiceImpl.kt
...inovasi/daerah/master/service/impl/ProvinceServiceImpl.kt
+11
-8
RegencyServiceImpl.kt
.../inovasi/daerah/master/service/impl/RegencyServiceImpl.kt
+5
-5
TagServiceImpl.kt
...iang/inovasi/daerah/master/service/impl/TagServiceImpl.kt
+5
-5
No files found.
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/ApplicationCategoryController.kt
View file @
13516436
...
@@ -3,6 +3,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
...
@@ -3,6 +3,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
import
id.co.sangkuriang.inovasi.daerah.master.model.request.ApplicationCategoryRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.ApplicationCategoryRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.service.ApplicationCategoryService
import
id.co.sangkuriang.inovasi.daerah.master.service.ApplicationCategoryService
import
org.springframework.beans.factory.annotation.Autowired
import
org.springframework.beans.factory.annotation.Autowired
import
org.springframework.http.ResponseEntity
import
org.springframework.http.ResponseEntity
...
@@ -18,12 +19,12 @@ class ApplicationCategoryController {
...
@@ -18,12 +19,12 @@ class ApplicationCategoryController {
private
lateinit
var
service
:
ApplicationCategoryService
private
lateinit
var
service
:
ApplicationCategoryService
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
service
.
getAll
(
page
)
return
service
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
*>?
{
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
ReturnData
>
{
return
service
.
getDetail
(
id
)
return
service
.
getDetail
(
id
)
}
}
...
@@ -31,7 +32,7 @@ class ApplicationCategoryController {
...
@@ -31,7 +32,7 @@ class ApplicationCategoryController {
fun
saveData
(
fun
saveData
(
@Valid
@ModelAttribute
request
:
ApplicationCategoryRequest
,
@Valid
@ModelAttribute
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
):
ResponseEntity
<
ReturnData
>
{
return
service
.
saveData
(
request
,
httpServletRequest
)
return
service
.
saveData
(
request
,
httpServletRequest
)
}
}
...
@@ -40,12 +41,12 @@ class ApplicationCategoryController {
...
@@ -40,12 +41,12 @@ class ApplicationCategoryController {
@PathVariable
id
:
String
,
@PathVariable
id
:
String
,
@Valid
@ModelAttribute
request
:
ApplicationCategoryRequest
,
@Valid
@ModelAttribute
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
):
ResponseEntity
<
ReturnData
>
{
return
service
.
updateData
(
id
,
request
,
httpServletRequest
)
return
service
.
updateData
(
id
,
request
,
httpServletRequest
)
}
}
@DeleteMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@DeleteMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
return
service
.
deleteData
(
request
,
httpServletRequest
)
return
service
.
deleteData
(
request
,
httpServletRequest
)
}
}
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/ProvinceController.kt
View file @
13516436
...
@@ -3,6 +3,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
...
@@ -3,6 +3,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.Pagination2Request
import
id.co.sangkuriang.inovasi.daerah.master.model.request.Pagination2Request
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Province
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Province
import
id.co.sangkuriang.inovasi.daerah.master.service.ProvinceService
import
id.co.sangkuriang.inovasi.daerah.master.service.ProvinceService
import
org.springframework.beans.factory.annotation.Autowired
import
org.springframework.beans.factory.annotation.Autowired
...
@@ -19,32 +20,32 @@ class ProvinceController {
...
@@ -19,32 +20,32 @@ class ProvinceController {
private
lateinit
var
service
:
ProvinceService
private
lateinit
var
service
:
ProvinceService
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
service
.
getAll
(
page
)
return
service
.
getAll
(
page
)
}
}
@PostMapping
(
value
=
[
"datatable"
],
produces
=
[
"application/json"
])
@PostMapping
(
value
=
[
"datatable"
],
produces
=
[
"application/json"
])
fun
datatable
(
@RequestBody
req
:
Pagination2Request
):
ResponseEntity
<
*>?
{
fun
datatable
(
@RequestBody
req
:
Pagination2Request
):
ResponseEntity
<
ReturnData
>
{
return
service
.
datatable
(
req
)
return
service
.
datatable
(
req
)
}
}
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
*>?
{
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
ReturnData
>
{
return
service
.
getDetail
(
id
)
return
service
.
getDetail
(
id
)
}
}
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
saveData
(
@Valid
@RequestBody
request
:
Province
):
ResponseEntity
<
*>?
{
fun
saveData
(
@Valid
@RequestBody
request
:
Province
):
ResponseEntity
<
ReturnData
>
{
return
service
.
saveData
(
request
)
return
service
.
saveData
(
request
)
}
}
@PutMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@PutMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
updateData
(
@PathVariable
id
:
String
,
@Valid
@RequestBody
request
:
Province
):
ResponseEntity
<
*>?
{
fun
updateData
(
@PathVariable
id
:
String
,
@Valid
@RequestBody
request
:
Province
):
ResponseEntity
<
ReturnData
>
{
return
service
.
updateData
(
id
,
request
)
return
service
.
updateData
(
id
,
request
)
}
}
@DeleteMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@DeleteMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
return
service
.
deleteData
(
request
,
httpServletRequest
)
return
service
.
deleteData
(
request
,
httpServletRequest
)
}
}
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/PublicController.kt
View file @
13516436
package
id.co.sangkuriang.inovasi.daerah.master.controller
package
id.co.sangkuriang.inovasi.daerah.master.controller
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.service.ApplicationCategoryService
import
id.co.sangkuriang.inovasi.daerah.master.service.ApplicationCategoryService
import
id.co.sangkuriang.inovasi.daerah.master.service.ProvinceService
import
id.co.sangkuriang.inovasi.daerah.master.service.ProvinceService
import
id.co.sangkuriang.inovasi.daerah.master.service.RegencyService
import
id.co.sangkuriang.inovasi.daerah.master.service.RegencyService
...
@@ -29,37 +30,37 @@ class PublicController {
...
@@ -29,37 +30,37 @@ class PublicController {
private
lateinit
var
regencyService
:
RegencyService
private
lateinit
var
regencyService
:
RegencyService
@GetMapping
(
value
=
[
"application-category/all"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"application-category/all"
],
produces
=
[
"application/json"
])
fun
applicationCategoryAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
applicationCategoryAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
applicationCategoryService
.
getAll
(
page
)
return
applicationCategoryService
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"tag/all"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"tag/all"
],
produces
=
[
"application/json"
])
fun
tagAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
tagAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
tagService
.
getAll
(
page
)
return
tagService
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"province/all"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"province/all"
],
produces
=
[
"application/json"
])
fun
provinceAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
provinceAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
provinceService
.
getAll
(
page
)
return
provinceService
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"province/get-by-name"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"province/get-by-name"
],
produces
=
[
"application/json"
])
fun
provinceGetByName
(
@RequestParam
(
"name"
)
name
:
String
):
ResponseEntity
<
*>?
{
fun
provinceGetByName
(
@RequestParam
(
"name"
)
name
:
String
):
ResponseEntity
<
ReturnData
>
{
return
provinceService
.
getByName
(
name
)
return
provinceService
.
getByName
(
name
)
}
}
@GetMapping
(
value
=
[
"regency/all"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"regency/all"
],
produces
=
[
"application/json"
])
fun
regencyAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
regencyAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
regencyService
.
getAll
(
page
)
return
regencyService
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"application-category/count"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"application-category/count"
],
produces
=
[
"application/json"
])
fun
applicationCategoryCount
():
ResponseEntity
<
*>?
{
fun
applicationCategoryCount
():
ResponseEntity
<
ReturnData
>
{
return
applicationCategoryService
.
count
()
return
applicationCategoryService
.
count
()
}
}
@GetMapping
(
value
=
[
"province/count"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"province/count"
],
produces
=
[
"application/json"
])
fun
provinceCount
():
ResponseEntity
<
*>?
{
fun
provinceCount
():
ResponseEntity
<
ReturnData
>
{
return
provinceService
.
count
()
return
provinceService
.
count
()
}
}
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/RegencyController.kt
View file @
13516436
...
@@ -2,6 +2,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
...
@@ -2,6 +2,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Regency
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Regency
import
id.co.sangkuriang.inovasi.daerah.master.service.RegencyService
import
id.co.sangkuriang.inovasi.daerah.master.service.RegencyService
import
org.springframework.beans.factory.annotation.Autowired
import
org.springframework.beans.factory.annotation.Autowired
...
@@ -18,27 +19,27 @@ class RegencyController {
...
@@ -18,27 +19,27 @@ class RegencyController {
private
lateinit
var
service
:
RegencyService
private
lateinit
var
service
:
RegencyService
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
service
.
getAll
(
page
)
return
service
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
*>?
{
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
ReturnData
>
{
return
service
.
getDetail
(
id
)
return
service
.
getDetail
(
id
)
}
}
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
saveData
(
@Valid
@RequestBody
request
:
Regency
):
ResponseEntity
<
*>?
{
fun
saveData
(
@Valid
@RequestBody
request
:
Regency
):
ResponseEntity
<
ReturnData
>
{
return
service
.
saveData
(
request
)
return
service
.
saveData
(
request
)
}
}
@PutMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@PutMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
updateData
(
@PathVariable
id
:
String
,
@Valid
@RequestBody
request
:
Regency
):
ResponseEntity
<
*>?
{
fun
updateData
(
@PathVariable
id
:
String
,
@Valid
@RequestBody
request
:
Regency
):
ResponseEntity
<
ReturnData
>
{
return
service
.
updateData
(
id
,
request
)
return
service
.
updateData
(
id
,
request
)
}
}
@DeleteMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@DeleteMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
return
service
.
deleteData
(
request
,
httpServletRequest
)
return
service
.
deleteData
(
request
,
httpServletRequest
)
}
}
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/controller/TagController.kt
View file @
13516436
...
@@ -2,6 +2,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
...
@@ -2,6 +2,7 @@ package id.co.sangkuriang.inovasi.daerah.master.controller
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Tag
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Tag
import
id.co.sangkuriang.inovasi.daerah.master.service.TagService
import
id.co.sangkuriang.inovasi.daerah.master.service.TagService
import
org.springframework.beans.factory.annotation.Autowired
import
org.springframework.beans.factory.annotation.Autowired
...
@@ -18,22 +19,22 @@ class TagController {
...
@@ -18,22 +19,22 @@ class TagController {
private
lateinit
var
service
:
TagService
private
lateinit
var
service
:
TagService
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*
>?
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>?
{
return
service
.
getAll
(
page
)
return
service
.
getAll
(
page
)
}
}
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@GetMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
*
>?
{
fun
getDetail
(
@PathVariable
id
:
String
):
ResponseEntity
<
ReturnData
>?
{
return
service
.
getDetail
(
id
)
return
service
.
getDetail
(
id
)
}
}
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
@PostMapping
(
value
=
[
""
],
produces
=
[
"application/json"
])
fun
saveData
(
@Valid
@RequestBody
request
:
Tag
):
ResponseEntity
<
*
>?
{
fun
saveData
(
@Valid
@RequestBody
request
:
Tag
):
ResponseEntity
<
ReturnData
>?
{
return
service
.
saveData
(
request
)
return
service
.
saveData
(
request
)
}
}
@PutMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
@PutMapping
(
value
=
[
"{id}"
],
produces
=
[
"application/json"
])
fun
updateData
(
@PathVariable
id
:
String
,
@Valid
@RequestBody
request
:
Tag
):
ResponseEntity
<
*
>?
{
fun
updateData
(
@PathVariable
id
:
String
,
@Valid
@RequestBody
request
:
Tag
):
ResponseEntity
<
ReturnData
>?
{
return
service
.
updateData
(
id
,
request
)
return
service
.
updateData
(
id
,
request
)
}
}
...
@@ -41,7 +42,7 @@ class TagController {
...
@@ -41,7 +42,7 @@ class TagController {
fun
deleteData
(
fun
deleteData
(
@Valid
@RequestBody
request
:
DeleteDataRequest
,
@Valid
@RequestBody
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*
>?
{
):
ResponseEntity
<
ReturnData
>?
{
return
service
.
deleteData
(
request
,
httpServletRequest
)
return
service
.
deleteData
(
request
,
httpServletRequest
)
}
}
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/helpers/Response.kt
View file @
13516436
...
@@ -4,8 +4,8 @@ import id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
...
@@ -4,8 +4,8 @@ import id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
org.springframework.http.HttpStatus
import
org.springframework.http.HttpStatus
import
org.springframework.http.ResponseEntity
import
org.springframework.http.ResponseEntity
fun
responseSuccess
(
message
:
String
=
"Success"
,
data
:
Any
?
=
null
):
ResponseEntity
<
*
>
{
fun
responseSuccess
(
message
:
String
=
"Success"
,
data
:
Any
?
=
null
):
ResponseEntity
<
ReturnData
>
{
return
ResponseEntity
<
Any
?
>(
return
ResponseEntity
<
ReturnData
>(
ReturnData
(
ReturnData
(
success
=
true
,
success
=
true
,
message
=
message
,
message
=
message
,
...
@@ -15,8 +15,8 @@ fun responseSuccess(message: String = "Success", data: Any? = null): ResponseEnt
...
@@ -15,8 +15,8 @@ fun responseSuccess(message: String = "Success", data: Any? = null): ResponseEnt
)
)
}
}
fun
responseCreated
(
message
:
String
=
"Created"
,
data
:
Any
?
=
null
):
ResponseEntity
<
*
>
{
fun
responseCreated
(
message
:
String
=
"Created"
,
data
:
Any
?
=
null
):
ResponseEntity
<
ReturnData
>
{
return
ResponseEntity
<
Any
?
>(
return
ResponseEntity
<
ReturnData
>(
ReturnData
(
ReturnData
(
success
=
true
,
success
=
true
,
message
=
message
,
message
=
message
,
...
@@ -26,8 +26,11 @@ fun responseCreated(message: String = "Created", data: Any? = null): ResponseEnt
...
@@ -26,8 +26,11 @@ fun responseCreated(message: String = "Created", data: Any? = null): ResponseEnt
)
)
}
}
fun
responseInternalServerError
(
message
:
String
=
"Internal Server Error"
,
data
:
Any
?
=
null
):
ResponseEntity
<*>
{
fun
responseInternalServerError
(
return
ResponseEntity
<
Any
?>(
message
:
String
=
"Internal Server Error"
,
data
:
Any
?
=
null
):
ResponseEntity
<
ReturnData
>
{
return
ResponseEntity
<
ReturnData
>(
ReturnData
(
ReturnData
(
success
=
false
,
success
=
false
,
message
=
message
,
message
=
message
,
...
@@ -37,8 +40,8 @@ fun responseInternalServerError(message: String = "Internal Server Error", data:
...
@@ -37,8 +40,8 @@ fun responseInternalServerError(message: String = "Internal Server Error", data:
)
)
}
}
fun
responseNotFound
(
message
:
String
=
"Not Found"
,
data
:
Any
?
=
null
):
ResponseEntity
<
*
>
{
fun
responseNotFound
(
message
:
String
=
"Not Found"
,
data
:
Any
?
=
null
):
ResponseEntity
<
ReturnData
>
{
return
ResponseEntity
<
Any
?
>(
return
ResponseEntity
<
ReturnData
>(
ReturnData
(
ReturnData
(
success
=
false
,
success
=
false
,
message
=
message
,
message
=
message
,
...
@@ -48,8 +51,11 @@ fun responseNotFound(message: String = "Not Found", data: Any? = null): Response
...
@@ -48,8 +51,11 @@ fun responseNotFound(message: String = "Not Found", data: Any? = null): Response
)
)
}
}
fun
responseUnprocessableEntity
(
message
:
String
=
"Unprocessable Entity"
,
data
:
Any
?
=
null
):
ResponseEntity
<*>
{
fun
responseUnprocessableEntity
(
return
ResponseEntity
<
Any
?>(
message
:
String
=
"Unprocessable Entity"
,
data
:
Any
?
=
null
):
ResponseEntity
<
ReturnData
>
{
return
ResponseEntity
<
ReturnData
>(
ReturnData
(
ReturnData
(
success
=
false
,
success
=
false
,
message
=
message
,
message
=
message
,
...
@@ -59,8 +65,8 @@ fun responseUnprocessableEntity(message: String = "Unprocessable Entity", data:
...
@@ -59,8 +65,8 @@ fun responseUnprocessableEntity(message: String = "Unprocessable Entity", data:
)
)
}
}
fun
responseBadRequest
(
message
:
String
=
"Bad Request"
,
data
:
Any
?
=
null
):
ResponseEntity
<
*
>
{
fun
responseBadRequest
(
message
:
String
=
"Bad Request"
,
data
:
Any
?
=
null
):
ResponseEntity
<
ReturnData
>
{
return
ResponseEntity
<
Any
?
>(
return
ResponseEntity
<
ReturnData
>(
ReturnData
(
ReturnData
(
success
=
false
,
success
=
false
,
message
=
message
,
message
=
message
,
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/ApplicationCategoryService.kt
View file @
13516436
...
@@ -3,24 +3,26 @@ package id.co.sangkuriang.inovasi.daerah.master.service
...
@@ -3,24 +3,26 @@ package id.co.sangkuriang.inovasi.daerah.master.service
import
id.co.sangkuriang.inovasi.daerah.master.model.request.ApplicationCategoryRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.ApplicationCategoryRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
org.hibernate.validator.internal.metadata.aggregated.ReturnValueMetaData
import
org.springframework.http.ResponseEntity
import
org.springframework.http.ResponseEntity
import
javax.servlet.http.HttpServletRequest
import
javax.servlet.http.HttpServletRequest
interface
ApplicationCategoryService
{
interface
ApplicationCategoryService
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
fun
saveData
(
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
fun
saveData
(
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
fun
updateData
(
fun
updateData
(
id
:
String
,
id
:
String
,
request
:
ApplicationCategoryRequest
,
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
):
ResponseEntity
<
ReturnData
>
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
fun
count
():
ResponseEntity
<
*>?
fun
count
():
ResponseEntity
<
ReturnData
>
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/ProvinceService.kt
View file @
13516436
...
@@ -3,25 +3,26 @@ package id.co.sangkuriang.inovasi.daerah.master.service
...
@@ -3,25 +3,26 @@ package id.co.sangkuriang.inovasi.daerah.master.service
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.Pagination2Request
import
id.co.sangkuriang.inovasi.daerah.master.model.request.Pagination2Request
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Province
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Province
import
org.springframework.http.ResponseEntity
import
org.springframework.http.ResponseEntity
import
javax.servlet.http.HttpServletRequest
import
javax.servlet.http.HttpServletRequest
interface
ProvinceService
{
interface
ProvinceService
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
fun
saveData
(
request
:
Province
):
ResponseEntity
<
*>?
fun
saveData
(
request
:
Province
):
ResponseEntity
<
ReturnData
>
fun
updateData
(
id
:
String
,
request
:
Province
):
ResponseEntity
<
*>?
fun
updateData
(
id
:
String
,
request
:
Province
):
ResponseEntity
<
ReturnData
>
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
fun
datatable
(
req
:
Pagination2Request
):
ResponseEntity
<
*>?
fun
datatable
(
req
:
Pagination2Request
):
ResponseEntity
<
ReturnData
>
fun
getByName
(
name
:
String
):
ResponseEntity
<
*>?
fun
getByName
(
name
:
String
):
ResponseEntity
<
ReturnData
>
fun
count
():
ResponseEntity
<
*>?
fun
count
():
ResponseEntity
<
ReturnData
>
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/RegencyService.kt
View file @
13516436
...
@@ -2,19 +2,20 @@ package id.co.sangkuriang.inovasi.daerah.master.service
...
@@ -2,19 +2,20 @@ package id.co.sangkuriang.inovasi.daerah.master.service
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Regency
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Regency
import
org.springframework.http.ResponseEntity
import
org.springframework.http.ResponseEntity
import
javax.servlet.http.HttpServletRequest
import
javax.servlet.http.HttpServletRequest
interface
RegencyService
{
interface
RegencyService
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
fun
saveData
(
request
:
Regency
):
ResponseEntity
<
*>?
fun
saveData
(
request
:
Regency
):
ResponseEntity
<
ReturnData
>
fun
updateData
(
id
:
String
,
request
:
Regency
):
ResponseEntity
<
*>?
fun
updateData
(
id
:
String
,
request
:
Regency
):
ResponseEntity
<
ReturnData
>
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/TagService.kt
View file @
13516436
...
@@ -2,19 +2,20 @@ package id.co.sangkuriang.inovasi.daerah.master.service
...
@@ -2,19 +2,20 @@ package id.co.sangkuriang.inovasi.daerah.master.service
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.DeleteDataRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.request.PaginationRequest
import
id.co.sangkuriang.inovasi.daerah.master.model.response.ReturnData
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Tag
import
id.co.sangkuriang.inovasi.daerah.master.pojo.Tag
import
org.springframework.http.ResponseEntity
import
org.springframework.http.ResponseEntity
import
javax.servlet.http.HttpServletRequest
import
javax.servlet.http.HttpServletRequest
interface
TagService
{
interface
TagService
{
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
fun
saveData
(
request
:
Tag
):
ResponseEntity
<
*>?
fun
saveData
(
request
:
Tag
):
ResponseEntity
<
ReturnData
>
fun
updateData
(
id
:
String
,
request
:
Tag
):
ResponseEntity
<
*>?
fun
updateData
(
id
:
String
,
request
:
Tag
):
ResponseEntity
<
ReturnData
>
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
}
}
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/impl/ApplicationCategoryServiceImpl.kt
View file @
13516436
...
@@ -31,7 +31,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
...
@@ -31,7 +31,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
@Autowired
@Autowired
private
lateinit
var
repo
:
ApplicationCategoryRepository
private
lateinit
var
repo
:
ApplicationCategoryRepository
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
val
page
:
Page
<
ApplicationCategory
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
val
page
:
Page
<
ApplicationCategory
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
...
@@ -54,7 +54,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
...
@@ -54,7 +54,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
}
}
}
}
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
{
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -69,7 +69,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
...
@@ -69,7 +69,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
override
fun
saveData
(
override
fun
saveData
(
request
:
ApplicationCategoryRequest
,
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
validateRequest
(
request
)
validateRequest
(
request
)
val
save
=
ApplicationCategory
()
val
save
=
ApplicationCategory
()
...
@@ -92,7 +92,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
...
@@ -92,7 +92,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
id
:
String
,
id
:
String
,
request
:
ApplicationCategoryRequest
,
request
:
ApplicationCategoryRequest
,
httpServletRequest
:
HttpServletRequest
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -121,7 +121,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
...
@@ -121,7 +121,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
}
}
}
}
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -154,7 +154,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
...
@@ -154,7 +154,7 @@ class ApplicationCategoryServiceImpl : ApplicationCategoryService {
}
}
}
}
override
fun
count
():
ResponseEntity
<
*>?
{
override
fun
count
():
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
responseSuccess
(
data
=
repo
.
getCount
())
responseSuccess
(
data
=
repo
.
getCount
())
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/impl/ProvinceServiceImpl.kt
View file @
13516436
...
@@ -40,7 +40,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -40,7 +40,7 @@ class ProvinceServiceImpl : ProvinceService {
@Autowired
@Autowired
private
lateinit
var
repoNative
:
ProvinceRepositoryNative
private
lateinit
var
repoNative
:
ProvinceRepositoryNative
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
val
page
:
Page
<
Province
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
val
page
:
Page
<
Province
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
...
@@ -63,7 +63,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -63,7 +63,7 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
datatable
(
req
:
Pagination2Request
):
ResponseEntity
<
*>?
{
override
fun
datatable
(
req
:
Pagination2Request
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
responseSuccess
(
data
=
repoNative
.
getPage
(
req
))
responseSuccess
(
data
=
repoNative
.
getPage
(
req
))
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
@@ -71,7 +71,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -71,7 +71,7 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
getByName
(
name
:
String
):
ResponseEntity
<
*>?
{
override
fun
getByName
(
name
:
String
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByName
(
name
.
trim
())
val
data
=
repo
.
findByName
(
name
.
trim
())
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -83,7 +83,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -83,7 +83,7 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
count
():
ResponseEntity
<
*>?
{
override
fun
count
():
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
responseSuccess
(
data
=
repo
.
getCount
())
responseSuccess
(
data
=
repo
.
getCount
())
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
@@ -91,7 +91,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -91,7 +91,7 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
{
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -103,7 +103,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -103,7 +103,7 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
saveData
(
request
:
Province
):
ResponseEntity
<
*>?
{
override
fun
saveData
(
request
:
Province
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
validateRequest
(
request
)
validateRequest
(
request
)
val
save
=
Province
()
val
save
=
Province
()
...
@@ -115,7 +115,7 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -115,7 +115,7 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
updateData
(
id
:
String
,
request
:
Province
):
ResponseEntity
<
*>?
{
override
fun
updateData
(
id
:
String
,
request
:
Province
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -132,7 +132,10 @@ class ProvinceServiceImpl : ProvinceService {
...
@@ -132,7 +132,10 @@ class ProvinceServiceImpl : ProvinceService {
}
}
}
}
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<*>?
{
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/impl/RegencyServiceImpl.kt
View file @
13516436
...
@@ -31,7 +31,7 @@ class RegencyServiceImpl : RegencyService {
...
@@ -31,7 +31,7 @@ class RegencyServiceImpl : RegencyService {
@Autowired
@Autowired
private
lateinit
var
repo
:
RegencyRepository
private
lateinit
var
repo
:
RegencyRepository
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
val
page
:
Page
<
Regency
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
val
page
:
Page
<
Regency
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
...
@@ -54,7 +54,7 @@ class RegencyServiceImpl : RegencyService {
...
@@ -54,7 +54,7 @@ class RegencyServiceImpl : RegencyService {
}
}
}
}
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
{
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -66,7 +66,7 @@ class RegencyServiceImpl : RegencyService {
...
@@ -66,7 +66,7 @@ class RegencyServiceImpl : RegencyService {
}
}
}
}
override
fun
saveData
(
request
:
Regency
):
ResponseEntity
<
*>?
{
override
fun
saveData
(
request
:
Regency
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
validateRequest
(
request
)
validateRequest
(
request
)
val
save
=
Regency
()
val
save
=
Regency
()
...
@@ -79,7 +79,7 @@ class RegencyServiceImpl : RegencyService {
...
@@ -79,7 +79,7 @@ class RegencyServiceImpl : RegencyService {
}
}
}
}
override
fun
updateData
(
id
:
String
,
request
:
Regency
):
ResponseEntity
<
*>?
{
override
fun
updateData
(
id
:
String
,
request
:
Regency
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -96,7 +96,7 @@ class RegencyServiceImpl : RegencyService {
...
@@ -96,7 +96,7 @@ class RegencyServiceImpl : RegencyService {
}
}
}
}
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
...
src/main/kotlin/id/co/sangkuriang/inovasi/daerah/master/service/impl/TagServiceImpl.kt
View file @
13516436
...
@@ -31,7 +31,7 @@ class TagServiceImpl : TagService {
...
@@ -31,7 +31,7 @@ class TagServiceImpl : TagService {
@Autowired
@Autowired
private
lateinit
var
repo
:
TagRepository
private
lateinit
var
repo
:
TagRepository
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
*>?
{
override
fun
getAll
(
page
:
PaginationRequest
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
val
page
:
Page
<
Tag
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
val
page
:
Page
<
Tag
?>?
=
if
(
page
.
enablePage
!!
==
1
)
{
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
var
direction
:
Sort
.
Direction
=
Sort
.
Direction
.
ASC
...
@@ -54,7 +54,7 @@ class TagServiceImpl : TagService {
...
@@ -54,7 +54,7 @@ class TagServiceImpl : TagService {
}
}
}
}
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
*>?
{
override
fun
getDetail
(
id
:
String
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -66,7 +66,7 @@ class TagServiceImpl : TagService {
...
@@ -66,7 +66,7 @@ class TagServiceImpl : TagService {
}
}
}
}
override
fun
saveData
(
request
:
Tag
):
ResponseEntity
<
*>?
{
override
fun
saveData
(
request
:
Tag
):
ResponseEntity
<
ReturnData
>
{
return
try
{
return
try
{
validateRequest
(
request
)
validateRequest
(
request
)
val
save
=
Tag
()
val
save
=
Tag
()
...
@@ -78,7 +78,7 @@ class TagServiceImpl : TagService {
...
@@ -78,7 +78,7 @@ class TagServiceImpl : TagService {
}
}
}
}
override
fun
updateData
(
id
:
String
,
request
:
Tag
):
ResponseEntity
<
*>?
{
override
fun
updateData
(
id
:
String
,
request
:
Tag
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
id
)
val
data
=
repo
.
findByIdAndActive
(
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
@@ -95,7 +95,7 @@ class TagServiceImpl : TagService {
...
@@ -95,7 +95,7 @@ class TagServiceImpl : TagService {
}
}
}
}
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
*>?
{
override
fun
deleteData
(
request
:
DeleteDataRequest
,
httpServletRequest
:
HttpServletRequest
):
ResponseEntity
<
ReturnData
>
{
try
{
try
{
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
val
data
=
repo
.
findByIdAndActive
(
request
.
id
)
if
(
data
.
isPresent
)
{
if
(
data
.
isPresent
)
{
...
...
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