package com.propertyManagement.web.controller.business.api;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxSlideshowBo;
import com.propertyManagement.business.domain.vo.WxSlideshowVo;
import com.propertyManagement.business.service.IWxSlideshowService;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.IsEnableType;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 轮播图

 *
 * @author liushuai
 * @date 2025-06-09
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/slideshow")
public class ApiWxSlideshowController extends BaseController {

    private final IWxSlideshowService iWxSlideshowService;

    /**
     * 查询轮播图列表
     */
    @GetMapping("/list")
    public R<List<WxSlideshowVo>> listAll(@Validated @NotNull(message = "类型不能为空") Integer type) {
        WxSlideshowBo wxSlideshowBo = new WxSlideshowBo();
        wxSlideshowBo.setIsEnable(IsEnableType.YES.getCode());
        wxSlideshowBo.setType(type);
        return R.ok(iWxSlideshowService.queryList(wxSlideshowBo));
    }
}
