
package com.tmerclub.cloud.product.controller.app;

import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.product.service.SpuTagService;
import com.tmerclub.cloud.product.vo.SpuTagVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 商品分组表
 *
 * @author lhd
 * @date 2021-02-20 14:28:10
 */
@RestController("appSpuTagController")
@RequestMapping("/ua/spu_tag")
@Tag(name = "app-商品分组")
public class SpuTagController {

    @Autowired
    private SpuTagService spuTagService;

    @GetMapping("/list")
    @Operation(summary = "获取商品分组列表", description = "获取商品分组列表")
    @Parameters(@Parameter(name = "shopId", description = "店铺id"))
    public ServerResponseEntity<List<SpuTagVO>> list(@RequestParam(value = "shopId", defaultValue = "0") Long shopId) {
        List<SpuTagVO> spuTagList = spuTagService.listByShopId(shopId);
        return ServerResponseEntity.success(spuTagList);
    }
}
