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

import com.qqchen.deploy.backend.deploy.dto.TeamMemberDTO;
import com.qqchen.deploy.backend.deploy.entity.TeamMember;
import com.qqchen.deploy.backend.deploy.query.TeamMemberQuery;
import com.qqchen.deploy.backend.deploy.service.ITeamMemberService;
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-members")
@Tag(name = "团队成员管理", description = "团队成员的增删改查接口")
public class TeamMemberApiController extends BaseController<TeamMember, TeamMemberDTO, Long, TeamMemberQuery> {

    @Resource
    private ITeamMemberService teamMemberService;

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

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

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

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

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

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

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

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

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

