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

import com.qqchen.deploy.backend.framework.api.Response;
import com.qqchen.deploy.backend.framework.controller.BaseController;
import com.qqchen.deploy.backend.workflow.dto.WorkflowCategoryDTO;
import com.qqchen.deploy.backend.workflow.dto.query.WorkflowCategoryQuery;
import com.qqchen.deploy.backend.workflow.entity.WorkflowCategory;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
 * 工作流分类API Controller
 *
 * @author qqchen
 * @date 2025-10-24
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/workflow/categories")
@Tag(name = "工作流分类管理", description = "工作流分类相关接口")
public class WorkflowCategoryApiController extends BaseController<WorkflowCategory, WorkflowCategoryDTO, Long, WorkflowCategoryQuery> {


    @Override
    public Response<WorkflowCategoryDTO> create(@Validated @RequestBody WorkflowCategoryDTO dto) {
        return super.create(dto);
    }

    @Override
    public Response<WorkflowCategoryDTO> update(@PathVariable Long id, @Validated @RequestBody WorkflowCategoryDTO dto) {
        return super.update(id, dto);
    }

    @Override
    public Response<Void> delete(@PathVariable Long id) {
        return super.delete(id);
    }

    @Override
    public Response<WorkflowCategoryDTO> findById(@PathVariable Long id) {
        return super.findById(id);
    }

    @Override
    public Response<List<WorkflowCategoryDTO>> findAll() {
        return super.findAll();
    }

    @Override
    public Response<Page<WorkflowCategoryDTO>> page(WorkflowCategoryQuery query) {
        return super.page(query);
    }

    @Override
    public Response<List<WorkflowCategoryDTO>> findAll(WorkflowCategoryQuery query) {
        return super.findAll(query);
    }

    @Override
    public CompletableFuture<Response<Void>> batchProcess(List<WorkflowCategoryDTO> dtos) {
        return super.batchProcess(dtos);
    }

    @Override
    protected void exportData(HttpServletResponse response, List<WorkflowCategoryDTO> data) {
        // TODO: 实现工作流分类数据导出逻辑
        log.warn("工作流分类数据导出功能暂未实现");
    }
}

