test value
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
dmitriy.churmeev
2026-04-04 12:33:35 +03:00
parent c175d9895b
commit f6234853e8
2 changed files with 26 additions and 27 deletions

View File

@@ -21,30 +21,29 @@ open class TestController(private val testService: TestService) {
//@PreAuthorize("hasRole('ADMIN')")
//@PreAuthorize("hasRole('USER')")
//
// @PostMapping("/add")
// fun add(@RequestBody testModel: TestModel): TestModel {
// return testService.add(testModel)
// }
//
// @PutMapping("/update")
// fun users(@RequestBody testModel: TestModel): TestModel {
// return testService.update(testModel)
// }
//
// @GetMapping("/{id}")
// fun get(@PathVariable(value = "id") id: Long): TestModel {
// return testService.get(id)!!
// }
//
// @DeleteMapping("/{id}")
// fun delete(@RequestBody id: Long) {
// testService.remove(id)
// }
//
// @GetMapping("/")
// fun getAll(): List<TestModel> {
// return testService.getAll()
// }
@PostMapping("/add")
fun add(@RequestBody testModel: TestModel): TestModel {
return testService.add(testModel)
}
@PutMapping("/update")
fun users(@RequestBody testModel: TestModel): TestModel {
return testService.update(testModel)
}
@GetMapping("/{id}")
fun get(@PathVariable(value = "id") id: Long): TestModel {
return testService.get(id)!!
}
@DeleteMapping("/{id}")
fun delete(@RequestBody id: Long) {
testService.remove(id)
}
@GetMapping("/")
fun getAll(): List<TestModel> {
return testService.getAll()
}
}

View File

@@ -3,11 +3,11 @@ package com.test.service
import com.test.entities.TestEntity
import com.test.model.TestModel
import com.test.repository.TestEntityRepository
//import org.springframework.data.repository.findByIdOrNull
import org.springframework.data.repository.findByIdOrNull
import org.springframework.stereotype.Service
@Service
class TestService(private val testEntityRepository: TestEntityRepository) {
class TestService(){//private val testEntityRepository: TestEntityRepository) {
// fun add(model: TestModel): TestModel {
// var entity = testEntityRepository.save(TestEntity(null, model.key, model.value))