DataJPA/src/main/kotlin/com/chantha/jdbc/controller/OrderController.kt
2020-05-15 17:20:27 +07:00

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()
}
}