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

import com.tmerclub.cloud.common.constant.Constant;
import com.tmerclub.cloud.common.product.vo.BrandVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.product.dto.BrandDTO;
import com.tmerclub.cloud.product.service.BrandService;
import io.swagger.v3.oas.annotations.Operation;
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.RestController;

import java.util.List;

/**
 * 品牌信息
 *
 * @author tmerclub
 * @date 2020-10-28 15:27:24
 */
@RestController("adminBrandController")
@RequestMapping("/mp/brand")
@Tag(name = "admin-品牌信息")
public class BrandController {

    @Autowired
    private BrandService brandService;

    @GetMapping("/list_by_params")
    @Operation(summary = "根据参数获取平台品牌列表", description = "根据参数获取平台品牌列表")
    public ServerResponseEntity<List<BrandVO>> listByParams(BrandDTO brandDTO) {
        brandDTO.setShopId(Constant.PLATFORM_SHOP_ID);
        List<BrandVO> brandVOList = brandService.listByParams(brandDTO);
        return ServerResponseEntity.success(brandVOList);
    }
}
