package com.zhongzheng.controller.cmmon; import com.zhongzheng.common.core.controller.BaseController; import com.zhongzheng.common.core.domain.AjaxResult; import com.zhongzheng.common.core.page.TableDataInfo; import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo; import com.zhongzheng.modules.goods.bo.GoodsQueryBo; import com.zhongzheng.modules.goods.service.IGoodsAttachedService; import com.zhongzheng.modules.goods.service.IGoodsService; import com.zhongzheng.modules.goods.vo.GoodsAttachedVo; import com.zhongzheng.modules.goods.vo.GoodsVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * 商品Controller * * @author hjl * @date 2021-10-12 */ @Api(value = "游客商品管理", tags = {"游客商品管理"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/app/common/goods") public class CommonGoodsController extends BaseController { private final IGoodsService iGoodsService; private final IGoodsAttachedService iGoodsAttachedService; /** * 查询商品列表 */ @ApiOperation("查询商品列表") @GetMapping("/list") public TableDataInfo list(GoodsQueryBo bo) { bo.setStatus(new ArrayList(Arrays.asList(1))); startPage(); List list = iGoodsService.selectList(bo); return getDataTable(list); } /** * 导出商品列表 */ /*selectList*/ /** * 获取商品详细信息 */ @ApiOperation("获取商品详细信息") @GetMapping("/{goodsId}") public AjaxResult getInfo(@PathVariable("goodsId" ) Long goodsId) { return AjaxResult.success(iGoodsService.selectDetail(goodsId)); } @ApiOperation("查询商品题库目录列表") @GetMapping("/bank/list") public AjaxResult> bankList(GoodsAttachedQueryBo bo) { List list = iGoodsAttachedService.selectList(bo); return AjaxResult.success(list); } }