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

import com.qqchen.deploy.backend.deploy.dto.TeamDTO;
import com.qqchen.deploy.backend.deploy.entity.Team;
import com.qqchen.deploy.backend.deploy.query.TeamQuery;
import com.qqchen.deploy.backend.deploy.service.ITeamService;
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;

@Slf4j
@RestController
@RequestMapping("/api/v1/teams")
@Tag(name = "团队管理", description = "团队的增删改查接口")
public class TeamApiController extends BaseController<Team, TeamDTO, Long, TeamQuery> {


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

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

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

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

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

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

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

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

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


