Controller.java

 package com.customerapp.practice.controller;


import com.customerapp.practice.model.Customer;

import com.customerapp.practice.service.CustomerService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;


@RestController

@RequestMapping("/api/customers")

public class CustomerController {


    @Autowired

    private CustomerService customerService;


    @PostMapping

    public Customer createCustomer(@RequestBody Customer customer) {

        return customerService.createCustomer(cu

stomer);

    }

}

Comments

Popular posts from this blog

Restaurant

TimePass

UIUXFILES