package com.datamate.datamanagement.interfaces.rest;

import com.datamate.common.interfaces.PagedResponse;
import com.datamate.datamanagement.application.KnowledgeItemApplicationService;
import com.datamate.datamanagement.interfaces.dto.KnowledgeItemSearchQuery;
import com.datamate.datamanagement.interfaces.dto.KnowledgeItemSearchResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 知识条目搜索控制器
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/data-management/knowledge-items")
public class KnowledgeItemSearchController {
    private final KnowledgeItemApplicationService knowledgeItemApplicationService;

    @GetMapping("/search")
    public PagedResponse<KnowledgeItemSearchResponse> search(KnowledgeItemSearchQuery query) {
        return knowledgeItemApplicationService.searchKnowledgeItems(query);
    }
}
