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

import com.qqchen.deploy.backend.deploy.dto.ApplicationCategoryDTO;
import com.qqchen.deploy.backend.deploy.entity.ApplicationCategory;
import com.qqchen.deploy.backend.deploy.query.ApplicationCategoryQuery;
import com.qqchen.deploy.backend.framework.api.Response;
import com.qqchen.deploy.backend.framework.controller.BaseController;
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控制器
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/application-category")
@Tag(name = "应用分类管理", description = "应用分类的增删改查接口")
public class ApplicationCategoryApiController extends BaseController<ApplicationCategory, ApplicationCategoryDTO, Long, ApplicationCategoryQuery> {


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

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

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

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

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

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

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

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

    @Override
    public void export(HttpServletResponse response, ApplicationCategoryQuery query) {
        super.export(response, query);
    }

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

