package com.lesingle.creation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lesingle.creation.entity.Department;
import com.lesingle.creation.dto.department.CreateDepartmentDTO;
import com.lesingle.creation.dto.department.UpdateDepartmentDTO;
import com.lesingle.creation.vo.department.DepartmentVO;

import java.util.List;

/**
 * 部门服务接口
 */
public interface DepartmentService extends IService<Department> {

    /**
     * 创建部门
     */
    DepartmentVO create(CreateDepartmentDTO dto, Long tenantId, Long creatorId);

    /**
     * 查询部门列表（分页）
     */
    List<DepartmentVO> list(Long tenantId, Long parentId);

    /**
     * 查询部门树形结构
     */
    List<DepartmentVO> tree(Long tenantId);

    /**
     * 获取部门详情
     */
    DepartmentVO getDetail(Long id, Long tenantId);

    /**
     * 更新部门
     */
    DepartmentVO update(Long id, UpdateDepartmentDTO dto, Long tenantId, Long modifierId);

    /**
     * 删除部门
     */
    void delete(Long id, Long tenantId);
}
