package com.snack.server.module.banner.controller;

import com.snack.server.common.Result;
import com.snack.server.module.banner.service.BannerService;
import com.snack.server.module.banner.vo.BannerVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
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;

/**
 * 轮播图（用户端 / 公开）
 */
@Tag(name = "轮播图（公开）")
@RestController
@RequestMapping("/api/banner")
@RequiredArgsConstructor
public class BannerPublicController {

    private final BannerService bannerService;

    @Operation(summary = "获取当前生效的轮播图列表")
    @GetMapping
    public Result<List<BannerVO>> list() {
        return Result.ok(bannerService.listActive());
    }
}
