package com.xindazhou.business.controller.app.community.banner;

import com.xindazhou.business.controller.app.community.banner.vo.BannerRespVO;
import com.xindazhou.business.service.community.banner.BannerService;
import com.xindazhou.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
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;

import static com.xindazhou.framework.common.pojo.CommonResult.success;

/**
 * 移动端 - Banner Controller
 *
 * @author xindazhou
 */
@Tag(name = "移动端 - Banner管理")
@RestController("appCommunityBannerController")
@RequestMapping("/app/community/banner")
@Validated
@Slf4j
public class BannerController {

    @Resource
    private BannerService bannerService;

    @GetMapping("/list")
    @Operation(summary = "获得Banner列表")
    public CommonResult<List<BannerRespVO>> getBannerList() {
        List<BannerRespVO> list = bannerService.getBannerList();
        return success(list);
    }

}

