Commit 366ceea3 authored by Ghitha Dinan's avatar Ghitha Dinan

add public service

parent d119a25f
package id.co.sangkuriang.inovasi.daerah.master.constant
const val SECRET = "PUJA-INDAH"
const val SECRET = "INOVASI-DAERAH"
const val TOKEN_PREFIX = "Bearer "
const val HEADER_STRING = "Authorization"
val TOKEN_FILTER_PATTERNS =
listOf(
"tag",
"application-category",
"province",
"regency",
"tag"
)
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.service.ApplicationCategoryService
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.TagService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
@RestController
@RequestMapping(path = ["public"])
class PublicController {
@Autowired
private lateinit var applicationCategoryService: ApplicationCategoryService
@Autowired
private lateinit var tagService: TagService
@Autowired
private lateinit var provinceService: ProvinceService
@Autowired
private lateinit var regencyService: RegencyService
@GetMapping(value = ["application-category/all"], produces = ["application/json"])
fun applicationCategoryAll(page: PaginationRequest): ResponseEntity<*>? {
return applicationCategoryService.getAll(page)
}
@GetMapping(value = ["tag/all"], produces = ["application/json"])
fun tagAll(page: PaginationRequest): ResponseEntity<*>? {
return tagService.getAll(page)
}
@GetMapping(value = ["province/all"], produces = ["application/json"])
fun provinceAll(page: PaginationRequest): ResponseEntity<*>? {
return provinceService.getAll(page)
}
@GetMapping(value = ["regency/all"], produces = ["application/json"])
fun regencyAll(page: PaginationRequest): ResponseEntity<*>? {
return regencyService.getAll(page)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment