package com.fdkankan.platform.goods.controller.api;

import com.fdkankan.common.controller.BaseController;
import com.fdkankan.platform.goods.service.IGoodsService;
import com.fdkankan.platform.goods.service.IGoodsSkuService;
import com.fdkankan.platform.goods.vo.ResponseGoods;
import com.fdkankan.platform.user.request.RequestCart;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 购物车模块
 */
@Log4j2
@RestController
@RequestMapping("/service/platform/goods")
public class GoodsController extends BaseController {

    @Autowired
    private IGoodsService goodsService;
    @Autowired
    private IGoodsSkuService goodsSkuService;

    /**
     * 商品详情
     * goodsId      goodsId
     * @param cart
     * @return
     */
    @RequestMapping(value = "/detail", method = RequestMethod.POST)
    public ResponseGoods detail(@RequestBody RequestCart cart) throws Exception {
        return goodsService.getDetail(cart.getGoodsId());
    }

}
