CustomerController.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.*;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import io.swagger.annotations.Api;
  13. import com.dk.mdm.service.mst.CustomerService;
  14. import java.util.List;
  15. @Api(tags = "客户资料API接口")
  16. @RestController
  17. @RequestMapping("/mst/customer")
  18. public class CustomerController{
  19. public BaseService<Customer> getService() {
  20. return customerService;
  21. }
  22. @Autowired
  23. private CustomerService customerService;
  24. /**
  25. * @desc : 条件查询
  26. * @author : 于继渤
  27. * @date : 2024/2/26 10:36
  28. */
  29. @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
  30. @PostMapping({"list_by"})
  31. public ResponseResultVO<PageList<CustomerResponse>> selectByCond(@RequestBody CustomerQuery customerQuery) {
  32. return customerService.selectByCond(customerQuery);
  33. }
  34. /**
  35. * @desc : 新建
  36. * @author : 于继渤
  37. * @date : 2023/1/5 9:39
  38. */
  39. @ApiOperation( value = "新建", notes = "v" )
  40. @PostMapping({"insert"})
  41. public ResponseResultVO<?> insert(@RequestBody CustomerVO customerVO) {
  42. return customerService.insert(customerVO);
  43. }
  44. /**
  45. * @desc : 编辑
  46. * @author : 于继渤
  47. * @date : 2023/1/5 9:39
  48. */
  49. @ApiOperation( value = "编辑", notes = "编辑" )
  50. @PostMapping({"update"})
  51. public ResponseResultVO<?> update(@RequestBody CustomerVO customerVO) {
  52. return customerService.update(customerVO);
  53. }
  54. /**
  55. * @desc : 查看
  56. * @author : 于继渤
  57. * @date : 2024/3/6 10:36
  58. */
  59. @PostMapping({"/{id}"})
  60. public ResponseResultVO<?> selectByIdRespone(@PathVariable String id) {
  61. return customerService.selectByIdRespone(id);
  62. }
  63. @ApiOperation(value = "不分页", notes = "分页、关联、条件查询")
  64. @PostMapping({"select_by_cond_no_page"})
  65. public ResponseResultVO<List<CustomerResponse>> selectByCondNoPage(@RequestBody CustomerQuery customerQuery) {
  66. return customerService.selectByCondNoPage(customerQuery);
  67. }
  68. }