This commit is contained in:
@@ -21,29 +21,29 @@ open class TestController(private val testService: TestService) {
|
|||||||
//@PreAuthorize("hasRole('ADMIN')")
|
//@PreAuthorize("hasRole('ADMIN')")
|
||||||
//@PreAuthorize("hasRole('USER')")
|
//@PreAuthorize("hasRole('USER')")
|
||||||
|
|
||||||
@PostMapping("/add")
|
// @PostMapping("/add")
|
||||||
fun add(@RequestBody testModel: TestModel): TestModel {
|
// fun add(@RequestBody testModel: TestModel): TestModel {
|
||||||
return testService.add(testModel)
|
// return testService.add(testModel)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PutMapping("/update")
|
// @PutMapping("/update")
|
||||||
fun users(@RequestBody testModel: TestModel): TestModel {
|
// fun users(@RequestBody testModel: TestModel): TestModel {
|
||||||
return testService.update(testModel)
|
// return testService.update(testModel)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping("/{id}")
|
// @GetMapping("/{id}")
|
||||||
fun get(@PathVariable(value = "id") id: Long): TestModel {
|
// fun get(@PathVariable(value = "id") id: Long): TestModel {
|
||||||
return testService.get(id)!!
|
// return testService.get(id)!!
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@DeleteMapping("/{id}")
|
// @DeleteMapping("/{id}")
|
||||||
fun delete(@RequestBody id: Long) {
|
// fun delete(@RequestBody id: Long) {
|
||||||
testService.remove(id)
|
// testService.remove(id)
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping("/")
|
// @GetMapping("/")
|
||||||
fun getAll(): List<TestModel> {
|
// fun getAll(): List<TestModel> {
|
||||||
return testService.getAll()
|
// return testService.getAll()
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,11 @@ package com.test.service
|
|||||||
import com.test.entities.TestEntity
|
import com.test.entities.TestEntity
|
||||||
import com.test.model.TestModel
|
import com.test.model.TestModel
|
||||||
import com.test.repository.TestEntityRepository
|
import com.test.repository.TestEntityRepository
|
||||||
import org.springframework.data.repository.findByIdOrNull
|
//import org.springframework.data.repository.findByIdOrNull
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class TestService(){//private val testEntityRepository: TestEntityRepository) {
|
class TestService() {
|
||||||
|
|
||||||
// fun add(model: TestModel): TestModel {
|
// fun add(model: TestModel): TestModel {
|
||||||
// var entity = testEntityRepository.save(TestEntity(null, model.key, model.value))
|
// var entity = testEntityRepository.save(TestEntity(null, model.key, model.value))
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ spring:
|
|||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
|
|
||||||
# JPA
|
# JPA
|
||||||
jpa:
|
# jpa:
|
||||||
hibernate:
|
# hibernate:
|
||||||
# ddl-auto: validate
|
# # ddl-auto: validate
|
||||||
show-sql: true
|
# show-sql: true
|
||||||
properties:
|
# properties:
|
||||||
hibernate:
|
# hibernate:
|
||||||
format_sql: true
|
# format_sql: true
|
||||||
database: postgresql
|
# database: postgresql
|
||||||
database-platform: org.hibernate.dialect.PostgreSQLDialect
|
# database-platform: org.hibernate.dialect.PostgreSQLDialect
|
||||||
|
|
||||||
# Keycloak Security
|
# Keycloak Security
|
||||||
security:
|
security:
|
||||||
@@ -44,8 +44,8 @@ logging:
|
|||||||
org.springframework.security: DEBUG
|
org.springframework.security: DEBUG
|
||||||
|
|
||||||
|
|
||||||
# Flyway
|
# # Flyway
|
||||||
flyway:
|
# flyway:
|
||||||
enabled: true
|
# enabled: true
|
||||||
locations: classpath:db/migration
|
# locations: classpath:db/migration
|
||||||
baseline-on-migrate: true
|
# baseline-on-migrate: true
|
||||||
Reference in New Issue
Block a user