TopGoodsController.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.zhongzheng.controller.goods;
  2. import com.zhongzheng.common.core.controller.BaseController;
  3. import com.zhongzheng.common.core.domain.AjaxResult;
  4. import com.zhongzheng.common.core.page.TableDataInfo;
  5. import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
  6. import com.zhongzheng.modules.top.goods.service.ITopGoodsService;
  7. import com.zhongzheng.modules.top.goods.vo.TopGoodsVo;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import lombok.RequiredArgsConstructor;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.GetMapping;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import java.util.List;
  16. /**
  17. * 商品Controller
  18. *
  19. * @author hjl
  20. * @date 2021-10-12
  21. */
  22. @Api(value = "商品控制器", tags = {"商品管理"})
  23. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  24. @RestController
  25. @RequestMapping("/sys/goods")
  26. public class TopGoodsController extends BaseController {
  27. private final ITopGoodsService iTopGoodsService;
  28. /**
  29. * 商品批量复制
  30. */
  31. @ApiOperation("商品批量复制(全量)")
  32. @GetMapping("/batch/copy/all")
  33. public AjaxResult<Void> goodsBatchCopyTenant() {
  34. return toAjax(iTopGoodsService.goodsBatchCopyTenant() ? 1 : 0);
  35. }
  36. /**
  37. * 商品关系ID处理(全量复制后的处理方法)
  38. */
  39. @ApiOperation("商品关系ID处理(全量复制后的处理方法)")
  40. @GetMapping("/batch/copy/dispose")
  41. public AjaxResult<Void> goodsBatchCopyDisposeTenant() {
  42. return toAjax(iTopGoodsService.goodsBatchCopyDisposeTenant() ? 1 : 0);
  43. }
  44. /**
  45. * 查询商品列表
  46. */
  47. @ApiOperation("查询商品列表")
  48. @GetMapping("/list")
  49. public TableDataInfo<TopGoodsVo> list(TopGoodsQueryBo bo) {
  50. startPage();
  51. List<TopGoodsVo> list = iTopGoodsService.selectList(bo);
  52. return getDataTable(list);
  53. }
  54. }