package com.reading.platform.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.reading.platform.dto.request.ClassCreateRequest;
import com.reading.platform.dto.request.ClassUpdateRequest;
import com.reading.platform.entity.Clazz;
import com.reading.platform.entity.ClassTeacher;
import com.reading.platform.entity.Student;

import java.util.List;

/**
 * Class Service Interface
 */
public interface ClassService {

    Clazz createClass(String tenantId, ClassCreateRequest request);

    Clazz updateClass(String id, ClassUpdateRequest request);

    Clazz getClassById(String id);

    Page<Clazz> getClassPage(String tenantId, Integer pageNum, Integer pageSize, String keyword, String grade, String status);

    void deleteClass(String id);

    void assignTeachers(String classId, List<String> teacherIds);

    void assignStudents(String classId, List<String> studentIds);

    void removeTeacher(String classId, String teacherId);

    void removeStudent(String classId, String studentId);

    List<String> getTeacherIdsByClassId(String classId);

    // ==================== 新增方法 ====================

    /**
     * 获取班级列表（无分页）
     */
    List<Clazz> getClassList(String tenantId);

    /**
     * 获取班级学生分页
     */
    Page<Student> getClassStudents(String classId, Integer pageNum, Integer pageSize, String keyword);

    /**
     * 获取班级教师列表
     */
    List<ClassTeacher> getClassTeachers(String classId);

    /**
     * 添加班级教师
     */
    ClassTeacher addClassTeacher(String tenantId, String classId, String teacherId, String role, Boolean isPrimary);

    /**
     * 更新班级教师角色
     */
    ClassTeacher updateClassTeacher(String tenantId, String classId, String teacherId, String role, Boolean isPrimary);

    /**
     * 移除班级教师
     */
    void removeClassTeacher(String tenantId, String classId, String teacherId);

}
