content: #set( $symbol_pound = '#' )
  #set( $symbol_dollar = '$' )
  #set( $symbol_escape = '\' )
  package ${package}.web;
  
  import com.alibaba.cola.dto.MultiResponse;
  import com.alibaba.cola.dto.Response;
  import ${package}.api.CustomerServiceI;
  import ${package}.dto.CustomerAddCmd;
  import ${package}.dto.CustomerListByNameQry;
  import ${package}.dto.data.CustomerDTO;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.*;
  
  @RestController
  public class CustomerController {
  
      @Autowired
      private CustomerServiceI customerService;
  
      @GetMapping(value = "/helloworld")
      public String helloWorld(){
          return "Hello, welcome to COLA world!";
      }
  
      @GetMapping(value = "/customer")
      public MultiResponse<CustomerDTO> listCustomerByName(@RequestParam(required = false) String name){
          CustomerListByNameQry customerListByNameQry = new CustomerListByNameQry();
          customerListByNameQry.setName(name);
          return customerService.listByName(customerListByNameQry);
      }
  
      @PostMapping(value = "/customer")
      public Response addCustomer(@RequestBody CustomerAddCmd customerAddCmd){
          return customerService.addCustomer(customerAddCmd);
      }
  }
  