|
|
@ -31,6 +31,7 @@ import com.epmet.dto.form.SaveCustomerFormDTO; |
|
|
|
import com.epmet.dto.result.ValidCustomerResultDTO; |
|
|
|
import com.epmet.excel.DemoExcel; |
|
|
|
import com.epmet.service.DemoService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.MediaType; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -100,18 +101,57 @@ public class DemoController { |
|
|
|
return demoService.insertEpmetDemo(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param |
|
|
|
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.ValidCustomerResultDTO>> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 测试:无参get请求feign示例 |
|
|
|
* @Date 2020/3/18 9:10 |
|
|
|
**/ |
|
|
|
@GetMapping("getValidCustomerlist") |
|
|
|
public Result<List<ValidCustomerResultDTO>> getValidCustomerList() { |
|
|
|
return demoService.getValidCustomerList(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId |
|
|
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 测试:有参get请求feign@PathVariable |
|
|
|
* @Date 2020/3/18 9:11 |
|
|
|
**/ |
|
|
|
@GetMapping("/queryCustomInfo/{customerId}") |
|
|
|
public Result<CustomerDTO> queryCustomInfo(@PathVariable("customerId") String customerId) { |
|
|
|
if (StringUtils.isBlank(customerId)) { |
|
|
|
return new Result<CustomerDTO>().error("customerId不能为空"); |
|
|
|
} |
|
|
|
return demoService.queryCustomerInfo(customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId |
|
|
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CustomerDTO> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 测试:有参get请求feign@RequestParam |
|
|
|
* @Date 2020/3/18 9:32 |
|
|
|
**/ |
|
|
|
@GetMapping("/queryCustomInfoByCustomerId") |
|
|
|
public Result<CustomerDTO> queryCustomInfoByCustomerId(@RequestParam("customerId") String customerId) { |
|
|
|
if (StringUtils.isBlank(customerId)) { |
|
|
|
return new Result<CustomerDTO>().error("customerId不能为空"); |
|
|
|
} |
|
|
|
return demoService.queryCustomInfoByCustomerId(customerId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param dto |
|
|
|
* @return com.epmet.commons.tools.utils.Result |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 测试:有参post请求示例,并返回插入主键 |
|
|
|
* @Date 2020/3/18 9:11 |
|
|
|
**/ |
|
|
|
@PostMapping("/saveCustomerInfo") |
|
|
|
public Result saveCustomerInfo(@RequestBody SaveCustomerFormDTO dto){ |
|
|
|
public Result<String> saveCustomerInfo(@RequestBody SaveCustomerFormDTO dto) { |
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
return demoService.saveCustomerInfo(dto); |
|
|
|
} |
|
|
|