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

import com.qqchen.deploy.backend.deploy.dto.TeamApplicationDTO;
import com.qqchen.deploy.backend.deploy.entity.TeamApplication;
import com.qqchen.deploy.backend.deploy.query.TeamApplicationQuery;
import com.qqchen.deploy.backend.deploy.service.ITeamApplicationService;
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.annotation.Resource;
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/team-applications")
@Tag(name = "团队应用关联管理", description = "团队应用关联的增删改查接口")
public class TeamApplicationApiController extends BaseController<TeamApplication, TeamApplicationDTO, Long, TeamApplicationQuery> {

    @Resource
    private ITeamApplicationService teamApplicationService;

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

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

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

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

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

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

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

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

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

