package com.younike.member;

import com.younike.common.core.controller.BaseController;
import com.younike.common.core.domain.AjaxResult;
import com.younike.framework.config.AnonymousAccess;
import com.younike.system.domain.IndexBanner;
import com.younike.system.service.IIndexBannerService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 首页轮播
 */
@Api("首页轮播接口")
@RestController
@RequestMapping("/member/banner")
public class MemberIndexBannerController extends BaseController {
    @Autowired
    private IIndexBannerService indexBannerService;

    /**
     * 查询首页轮播列表
     */
    @ApiOperation("查询首页轮播列表")
//    @PreAuthorize("@ss.hasRole('operation')")
    @GetMapping("/list")
    @AnonymousAccess
    public AjaxResult list(@RequestParam(value = "bizType", required = false) Integer bizType) {
        IndexBanner indexBanner = new IndexBanner();
        indexBanner.setBizType(bizType);
        return AjaxResult.success(indexBannerService.selectIndexBannerList(indexBanner));
    }
}
