CustomerController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.dk.mdm.controller.mst;
  2. import com.dk.common.model.pojo.PageList;
  3. import com.dk.common.response.ResponseResultVO;
  4. import com.dk.mdm.model.pojo.mst.Customer;
  5. import com.dk.common.service.BaseService;
  6. import com.dk.mdm.model.query.mst.CustomerQuery;
  7. import com.dk.mdm.model.response.mst.CustomerResponse;
  8. import com.dk.mdm.model.vo.mst.CustomerVO;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import io.swagger.annotations.Api;
  16. import com.dk.mdm.service.mst.CustomerService;
  17. @Api(tags = "客户资料API接口")
  18. @RestController
  19. @RequestMapping("/mst/customer")
  20. public class CustomerController{
  21. public BaseService<Customer> getService() {
  22. return customerService;
  23. }
  24. @Autowired
  25. private CustomerService customerService;
  26. /**
  27. * @desc : 条件查询
  28. * @author : 于继渤
  29. * @date : 2024/2/26 10:36
  30. */
  31. @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
  32. @PostMapping({"list_by"})
  33. public ResponseResultVO<PageList<CustomerResponse>> selectByCond(@RequestBody CustomerQuery customerQuery) {
  34. return customerService.selectByCond(customerQuery);
  35. }
  36. /**
  37. * @desc : 新建
  38. * @author : 于继渤
  39. * @date : 2023/1/5 9:39
  40. */
  41. @ApiOperation( value = "新建", notes = "v" )
  42. @PostMapping({"insert"})
  43. public ResponseResultVO<?> insert(@RequestBody CustomerVO customerVO) {
  44. return customerService.insert(customerVO);
  45. }
  46. /**
  47. * @desc : 编辑
  48. * @author : 于继渤
  49. * @date : 2023/1/5 9:39
  50. */
  51. @ApiOperation( value = "编辑", notes = "编辑" )
  52. @PostMapping({"update"})
  53. public ResponseResultVO<?> update(@RequestBody CustomerVO customerVO) {
  54. return customerService.update(customerVO);
  55. }
  56. }