/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.platform.controller;

import com.yami.shop.bean.model.Sku;
import com.yami.shop.service.SkuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import com.yami.shop.common.util.R;
/**
 * 商品SKU管理实现
 *
 * @author lgh
 * @version 1.0.0
 * @since 2018-11-26
 */
@RestController
@RequestMapping("/platform/sku")
@AllArgsConstructor
public class SkuController {

    private final SkuService skuService;

    @GetMapping("/getAllSkuList")
    @PreAuthorize("@pms.hasPermission('plateform:sku:list')")
    public R<List<Sku>> getSkuListByProdId(Long prodId) {
        List<Sku> skus = skuService.listByProdId(prodId);
        return R.SUCCESS(skus);
    }
}
