package com.qqchen.deploy.backend.system.api;

import com.qqchen.deploy.backend.system.entity.Department;
import com.qqchen.deploy.backend.framework.api.Response;
import com.qqchen.deploy.backend.framework.controller.BaseController;
import com.qqchen.deploy.backend.system.model.DepartmentDTO;
import com.qqchen.deploy.backend.system.model.query.DepartmentQuery;
import com.qqchen.deploy.backend.system.model.response.DepartmentResponse;
import com.qqchen.deploy.backend.system.service.IDepartmentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "部门管理")
@RestController
@RequestMapping("/api/v1/department")
public class DepartmentApiController extends BaseController<Department, DepartmentDTO, Long, DepartmentQuery> {

    @Resource
    private IDepartmentService departmentService;

    @Operation(summary = "获取部门树")
    @GetMapping("/tree")
    public Response<List<DepartmentResponse>> getTree() {
        return Response.success(((IDepartmentService) service).getTree());
    }

    @Override
    protected void exportData(HttpServletResponse response, List<DepartmentDTO> data) {
        // TODO: 实现导出功能
    }
} 