package com.pharmacopoeia.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/v1/exam/chapter")
public class ExamChapterController {

    @GetMapping("/tree")
    public ResponseEntity<Map<String, Object>> getChapterTree() {
        return ResponseEntity.ok(Map.of("subjects", List.of(
                Map.of("id", "yao1", "name", "药学专业知识一", "chapters", List.of(
                        Map.of("id", "ch01", "name", "药品与药品质量标准", "knowledge_count", 0),
                        Map.of("id", "ch02", "name", "药物的结构与作用", "knowledge_count", 0)
                )),
                Map.of("id", "yao2", "name", "药学专业知识二", "chapters", List.of(
                        Map.of("id", "ch01", "name", "精神与中枢神经系统疾病用药", "knowledge_count", 0)
                )),
                Map.of("id", "fagui", "name", "药事管理与法规", "chapters", List.of(
                        Map.of("id", "ch01", "name", "执业药师与健康中国战略", "knowledge_count", 0)
                )),
                Map.of("id", "zonghe", "name", "药学综合知识与技能", "chapters", List.of(
                        Map.of("id", "ch01", "name", "执业药师与药学服务", "knowledge_count", 0)
                ))
        )));
    }

    @GetMapping("/{chapterId}")
    public ResponseEntity<Map<String, Object>> getChapterKnowledge(@PathVariable String chapterId) {
        return ResponseEntity.ok(Map.of(
                "chapter_id", chapterId,
                "knowledge_points", List.of(),
                "message", "待数据入库后可用"
        ));
    }
}
