24 lines
883 B
Kotlin
24 lines
883 B
Kotlin
package com.chantha.jdbc.controller
|
|
|
|
import com.chantha.jdbc.jpa.model.Customer
|
|
import com.chantha.jdbc.jpa.model.Order
|
|
import com.chantha.jdbc.jpa.model.view.CustomerOrderView
|
|
import com.chantha.jdbc.jpa.repo.CustomerRepo
|
|
import com.chantha.jdbc.jpa.service.customer.CustomerService
|
|
import com.chantha.jdbc.jpa.view.ViewsInvoice
|
|
import org.apache.tomcat.util.json.JSONParser
|
|
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.RestController
|
|
|
|
@Suppress("UNCHECKED_CAST")
|
|
@RestController
|
|
class CustomerController @Autowired constructor(private val customerService: CustomerService) {
|
|
|
|
|
|
@GetMapping("/customer")
|
|
fun customer():List<CustomerOrderView>{
|
|
return customerService.fetchAllCustomerOrder()
|
|
}
|
|
} |