package com.zd.airbottle.controller;

import com.zd.airbottle.domain.QpAirGoodsConfig;
import com.zd.airbottle.domain.vo.QpAirGoodsConfigVo;
import com.zd.airbottle.service.IQpAirGoodsConfigService;
import com.zd.common.core.web.controller.BaseController;
import com.zd.common.core.web.domain.ResultData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.List;

/**
 * 货物配置Controller
 *
 * @author zd
 * @date 2022-05-17
 */
@RestController
@Api(tags = "【货物配置】")
@RequestMapping("/goods/config")
public class QpAirGoodsConfigController extends BaseController<QpAirGoodsConfig> {
    @Autowired
    private IQpAirGoodsConfigService qpAirGoodsConfigService;

    /**
     * 获取货物配置详细信息
     */
    @ApiOperation(value = "获取货物配置详细信息")
    @GetMapping(value = "/{id}")
    public ResultData<List<QpAirGoodsConfigVo>> getInfo(@PathVariable("id") Long goodsId) {
        return ResultData.success(qpAirGoodsConfigService.getGoodsInfo(goodsId));
    }
}
