Commit bdb85673 authored by 1516160's avatar 1516160

Upload New File

parent 4ced8f1c
package com.altimetrik.playground.candidate.assessment.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.altimetrik.playground.candidate.assessment.request.CustomerReq;
import com.altimetrik.playground.candidate.assessment.request.ProductReq;
import com.altimetrik.playground.candidate.assessment.service.IAdminDbConsole;
@RestController
@RequestMapping(value = "/ecommerce")
public class ECommerceController {
@Autowired
private IAdminDbConsole service;
@PostMapping("/newCustomer")
public String newCustomer(@RequestBody CustomerReq request) {
return service.newCustomer(request);
}
@PostMapping("/addProduct")
public String addProduct(@RequestBody ProductReq request) {
return service.addProduct(request);
}
@DeleteMapping("/removeProduct")
public String removeItem(@RequestBody ProductReq request) {
return service.removeItem(request);
}
@PutMapping("/addProduct")
public String updateProduct(@RequestBody ProductReq request) {
return service.updateProduct(request);
}
@GetMapping("/getCartDetails/{email}")
public List<ProductReq> getCartdetails(@PathVariable("email") String email) {
return service.getCartdetails(email);
}
@PutMapping("/doCheckOut")
public String doCheckOut(@RequestBody List<ProductReq> request) {
return service.doCheckOut(request);
}
@GetMapping("/getProduct/{prodName}")
public List<ProductReq> getProduct(@PathVariable("prodName") String prodName) {
return service.getProduct(prodName);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment