package org.dromara.mall.product.controller.app;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.mall.product.domain.bo.MallBrandBo;
import org.dromara.mall.product.domain.vo.MallBrandVo;
import org.dromara.mall.product.service.MallBrandService;
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 pengles
 */
@Tag(name = "移动端-品牌", description = "品牌查询接口")
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/mall/product/brand")
public class AppMallBrandController {

    private final MallBrandService mallBrandService;

    /**
     * 查询品牌列表（移动端）
     */
    @Operation(summary = "查询品牌列表", description = "查询启用的品牌列表")
    @GetMapping("/list")
    public R<List<MallBrandVo>> list() {
        MallBrandBo bo = new MallBrandBo();
        bo.setStatus(0); // 只查询启用的品牌
        List<MallBrandVo> list = mallBrandService.queryList(bo);
        return R.ok(list);
    }
}
