package com.pharmacopoeia.controller;

import com.pharmacopoeia.dto.ApiResponse;
import com.pharmacopoeia.entity.QuickAsk;
import com.pharmacopoeia.service.AdminKnowledgeService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 药典快捷提问标签 公开查询端点（不需要 JWT 鉴权）。
 * 管理端的 CRUD 在 AdminKnowledgeController 中（/api/v1/admin/knowledge/quick-asks）。
 */
@RestController
@RequestMapping("/api/v1/yaodian")
public class YaodianQuickAskController {

    private final AdminKnowledgeService service;

    public YaodianQuickAskController(AdminKnowledgeService service) {
        this.service = service;
    }

    @GetMapping("/quick-asks")
    public ResponseEntity<ApiResponse<List<QuickAsk>>> listQuickAsks() {
        return ResponseEntity.ok(ApiResponse.success(service.listQuickAsks()));
    }
}
