package com.yingpaipay.business.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.yingpaipay.business.domain.bo.DocumentSearchBo;
import com.yingpaipay.business.domain.vo.DocumentVo;
import com.yingpaipay.business.service.IDocumentService;
import lombok.RequiredArgsConstructor;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search")
@RequiredArgsConstructor
public class SearchController {

    private final IDocumentService documentService;

    @SaCheckPermission("search:index:list")
    @GetMapping("/list")
    public TableDataInfo<DocumentVo> list(DocumentSearchBo bo, PageQuery pageQuery) {
        return documentService.listOnSearch(bo, pageQuery);
    }

}
