DataJPA/src/main/kotlin/com/chantha/jdbc/controller/CustomerController.kt

24 lines
883 B
Kotlin
Raw Normal View History

2020-05-15 17:20:27 +07:00
package com.chantha.jdbc.controller
import com.chantha.jdbc.jpa.model.Customer
2020-05-16 17:20:48 +07:00
import com.chantha.jdbc.jpa.model.Order
2020-05-17 12:25:24 +07:00
import com.chantha.jdbc.jpa.model.view.CustomerOrderView
import com.chantha.jdbc.jpa.repo.CustomerRepo
2020-05-15 17:20:27 +07:00
import com.chantha.jdbc.jpa.service.customer.CustomerService
2020-05-16 17:20:48 +07:00
import com.chantha.jdbc.jpa.view.ViewsInvoice
import org.apache.tomcat.util.json.JSONParser
2020-05-15 17:20:27 +07:00
import org.springframework.beans.factory.annotation.Autowired
2020-05-16 17:20:48 +07:00
import org.springframework.http.ResponseEntity
2020-05-15 17:20:27 +07:00
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) {
2020-05-17 12:25:24 +07:00
2020-05-15 17:20:27 +07:00
@GetMapping("/customer")
2020-05-17 12:25:24 +07:00
fun customer():List<CustomerOrderView>{
return customerService.fetchAllCustomerOrder()
2020-05-15 17:20:27 +07:00
}
}