package com.chantha.jdbc.controller import com.chantha.jdbc.jpa.model.Product import com.chantha.jdbc.jpa.model.view.ProductWithOrderDetail import com.chantha.jdbc.jpa.repo.ProductRepo import com.chantha.jdbc.jpa.service.product.ProductService import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController @RestController public class ProductController @Autowired constructor(private val productService: ProductService,private val productRepo: ProductRepo) { @GetMapping("/api/product/order") fun product():List{ return productService.fetchAllProducts() } @GetMapping("/api/product/getproduct") fun getAllProduct():List{ return productRepo.readAllRecord() } }