package com.zhongzheng.controller.goods;

import com.zhongzheng.common.annotation.Log;
import com.zhongzheng.common.core.controller.BaseController;
import com.zhongzheng.common.core.domain.AjaxResult;
import com.zhongzheng.common.core.page.TableDataInfo;
import com.zhongzheng.common.enums.BusinessType;
import com.zhongzheng.modules.goods.bo.*;
import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
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 io.swagger.models.auth.In;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

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("/goods")
public class GoodsController extends BaseController {

    private final IGoodsService iGoodsService;

    private final IGoodsAttachedService iGoodsAttachedService;




    /**
     * 获取商品详细信息
     */
    @ApiOperation("获取题库商品错题和收集题数")
    @GetMapping("/{goodsId}")
    public AjaxResult<GoodsVo> getBankGoodsNum(@PathVariable("goodsId" ) Long goodsId) {
        return AjaxResult.success(iGoodsService.selectDetail(goodsId));
    }




}
