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

import com.qqchen.deploy.backend.deploy.dto.EnvironmentDTO;
import com.qqchen.deploy.backend.deploy.entity.Environment;
import com.qqchen.deploy.backend.deploy.query.EnvironmentQuery;
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 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控制器
 */
@Tag(name = "环境管理", description = "环境管理相关接口")
@RestController
@RequestMapping("/api/v1/environments")
public class EnvironmentApiController extends BaseController<Environment, EnvironmentDTO, Long, EnvironmentQuery> {


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

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

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

    @Override
    public Response<EnvironmentDTO> findById(@Validated @RequestBody Long id) {
        return super.findById(id);
    }

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

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

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

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

    @Override
    protected void exportData(HttpServletResponse response, List<EnvironmentDTO> data) {
        // TODO: 实现导出逻辑
    }
} 