package com.seer.teach.teacher.controller.app;

import com.seer.teach.common.PageListBean;
import com.seer.teach.common.ResultBean;
import com.seer.teach.common.annotation.DecryptionAnnotation;
import com.seer.teach.common.annotation.EncryptionAnnotation;
import com.seer.teach.common.annotation.LogPrint;
import com.seer.teach.teacher.common.req.GetUnitsReq;
import com.seer.teach.teacher.common.resp.UnitsResp;
import com.seer.teach.teacher.service.UnitsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: Captain
 * @Description: Ai批改
 * @Date: 2025-05-12 14:28
 */
@Validated
@RestController
@EncryptionAnnotation
@DecryptionAnnotation
@RequiredArgsConstructor
@Tag(name = "app - 知识点")
@RequestMapping("/app/know")
public class KnowController {

    private final UnitsService unitsService;

    @LogPrint
    @Operation(summary = "获取科目所有单元")
    @PostMapping("/units")
    public ResultBean<PageListBean<UnitsResp>> getUnits(@RequestBody @Validated GetUnitsReq params) {
        PageListBean<UnitsResp> results = unitsService.list(params);
        return ResultBean.success(results);
    }

}
