package com.yonge.cooleshow.website.controller.open;

import com.yonge.cooleshow.biz.dal.entity.SysNewsInformation;
import com.yonge.cooleshow.biz.dal.service.BannerService;
import com.yonge.cooleshow.common.controller.BaseController;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

/**
 * Description
 *
 * @author liujunchi
 * @date 2022-06-23
 */
@RestController
@RequestMapping("/open/banner")
@Api(value = "轮播图", tags = "轮播图")
public class OpenNewsController  extends BaseController {

    @Autowired
    private BannerService bannerService;

    /**
     * 查询分页tree
     */
    @GetMapping("/list")
    @ApiOperation(value = "官网轮播图列表")
    public HttpResponseResult<List<SysNewsInformation>> tree() {
        List<SysNewsInformation> treeList = bannerService.selectBanner();
        return succeed(treeList);
    }

}
