SaleChannelController.java 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.SaleChannel;
  5. import com.dk.common.service.BaseService;
  6. import com.dk.mdm.model.query.mst.SaleChannelQuery;
  7. import com.dk.mdm.model.response.mst.WarehouseResponse;
  8. import com.dk.mdm.model.vo.mst.SaleChannelVO;
  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.SaleChannelService;
  14. @Api(tags = "销售渠道API接口")
  15. @RestController
  16. @RequestMapping("/mst/saleChannel")
  17. public class SaleChannelController{
  18. public BaseService<SaleChannel> getService() {
  19. return saleChannelService;
  20. }
  21. @Autowired
  22. private SaleChannelService saleChannelService;
  23. /**
  24. * @desc : 条件查询
  25. * @author : 于继渤
  26. * @date : 2024/2/26 10:36
  27. */
  28. @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
  29. @PostMapping({"list_by"})
  30. public ResponseResultVO<PageList<WarehouseResponse>> selectByCond(@RequestBody SaleChannelQuery saleChannelQuery) {
  31. return saleChannelService.selectByCond(saleChannelQuery);
  32. }
  33. /**
  34. * @desc : 新建
  35. * @author : 于继渤
  36. * @date : 2023/1/5 9:39
  37. */
  38. @ApiOperation(value = "新建", notes = "新建")
  39. @PostMapping({"insert"})
  40. public ResponseResultVO<?> insert(@RequestBody SaleChannelVO saleChannelVO) {
  41. return saleChannelService.insert(saleChannelVO);
  42. }
  43. /**
  44. * @desc : 编辑
  45. * @author : 于继渤
  46. * @date : 2023/1/5 9:39
  47. */
  48. @ApiOperation( value = "编辑", notes = "编辑" )
  49. @PostMapping({"update"})
  50. public ResponseResultVO<?> update(@RequestBody SaleChannelVO saleChannelVO) {
  51. return saleChannelService.update(saleChannelVO);
  52. }
  53. /**
  54. * @desc : 停用
  55. * @author : 于继渤
  56. * @date : 2023/1/4 9:39
  57. */
  58. @PostMapping("disable/{id}")
  59. public ResponseResultVO<Boolean> disable(@PathVariable String id) {
  60. return this.getService().disable(id);
  61. }
  62. /**
  63. * @desc : 启用
  64. * @author : 于继渤
  65. * @date : 2023/1/4 9:39
  66. */
  67. @PostMapping("enable/{id}")
  68. public ResponseResultVO<Boolean> enable(@PathVariable String id) {
  69. return this.getService().enable(id);
  70. }
  71. }