16 lines
530 B
Kotlin
16 lines
530 B
Kotlin
package com.chantha.jdbc.controller
|
|
|
|
import com.chantha.jdbc.jpa.model.Order
|
|
import com.chantha.jdbc.jpa.service.order.OrderService
|
|
import org.springframework.beans.factory.annotation.Autowired
|
|
import org.springframework.web.bind.annotation.GetMapping
|
|
import org.springframework.web.bind.annotation.RestController
|
|
|
|
@RestController
|
|
class OrderController @Autowired constructor(private val orderService: OrderService) {
|
|
|
|
@GetMapping("/")
|
|
fun findAllOrder():List<Order>{
|
|
return orderService.findAll().toList()
|
|
}
|
|
} |