package org.dromara.main.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.main.domain.bo.BannerBo;
import org.dromara.main.domain.vo.BannerVo;
import org.dromara.main.service.IBannerService;
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;

/**
 * 门户轮播图接口
 */
@SaIgnore
@RequiredArgsConstructor
@RestController
@RequestMapping("/portal/banner")
public class PortalBannerController extends BaseController {

    private final IBannerService bannerService;

    @GetMapping("/list")
    public R<List<BannerVo>> getBannerList() {
        BannerBo bo = new BannerBo();
        bo.setIsEnabled(1L);
        return R.ok(bannerService.queryList(bo));
    }
}
