package org.jeecg.modules.api.teambuyController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.GoodsService;
import org.jeecg.modules.teambuyCategory.entity.TeambuyCategory;
import org.jeecg.modules.teambuyGoods.entity.TeambuyGoods;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="首页-商品信息相关接口")
@RestController
@RequestMapping("/teambuy/goods")
@Slf4j
public class GoodsController {
    /******************************************************************************************************************/
    //商品信息
    @Resource
    private GoodsService goodsService;
    /******************************************************************************************************************/
    //查看商品分类列表
    @ApiOperation(value="商品信息-查看商品分类列表", notes="商品信息-查看商品分类列表")
    @RequestMapping(value = "/queryCategoryList", method = {RequestMethod.GET})
    public Result<?> queryCategoryList(TeambuyCategory teambuyCategory, PageBean pageBean){
        return goodsService.queryCategoryList(teambuyCategory, pageBean);
    }

    //查看商品信息列表
    @ApiOperation(value="商品信息-查询商品信息列表", notes="商品信息-查询商品信息列表")
    @RequestMapping(value = "/queryGoodsList", method = {RequestMethod.GET})
    public Result<?> queryGoodsList(TeambuyGoods teambuyGoods, PageBean pageBean){
        return goodsService.queryGoodsList(teambuyGoods, pageBean);
    }

    //查看商品信息详情
    @ApiOperation(value="商品信息-查询商品信息详情", notes="商品信息-查询商品信息详情")
    @RequestMapping(value = "/queryGoodsById", method = {RequestMethod.GET})
    public Result<?> queryItemById(String id){
        return goodsService.queryGoodsById(id);
    }

}
