package com.rongwei.bsserver.sys.controller;

import com.rongwei.bscommon.sys.service.KbKnowledgeLedgerService;
import com.rongwei.bscommon.sys.service.KnowledgeBaseService;
import com.rongwei.bscommon.sys.service.impl.KnowledgeBaseServiceImpl;
import com.rongwei.bscommon.sys.utils.ExceptionUtils;
import com.rongwei.bsentity.vo.KnowledgeBaseSearchVo;
import com.rongwei.rwcommon.base.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * KnowledgebaseController class
 *
 * @author XH
 * @date 2024/01/11
 */
@RestController()
@RequestMapping("/kb")
public class KnowledgeBaseController {

    @Autowired
    private KnowledgeBaseService knowledgeBaseService;

    /**
     * 定时任务，每天凌晨执行一次，检查知识库台账中，文档状态（FILESTATUS）为：生效，并且失效时间（FAILTUREDATE）在今天之前 的文档，将状态改为：过期
     * @return
     */
    @PostMapping("/search")
    public R search(@RequestBody KnowledgeBaseSearchVo knowledgeBaseSearchVo){
        return knowledgeBaseService.search(knowledgeBaseSearchVo);
    }
}
