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

import com.qqchen.deploy.backend.framework.api.Response;
import com.qqchen.deploy.backend.framework.controller.BaseController;
import com.qqchen.deploy.backend.deploy.entity.JenkinsSyncHistory;
import com.qqchen.deploy.backend.deploy.dto.JenkinsSyncHistoryDTO;
import com.qqchen.deploy.backend.deploy.query.JenkinsSyncHistoryQuery;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletResponse;

import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
 * Jenkin同步日志 Controller
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/jenkins-sync-history")
@Tag(name = "Jenkin同步日志管理", description = "Jenkin同步日志管理相关接口")
public class JenkinsSyncHistoryApiController extends BaseController<JenkinsSyncHistory, JenkinsSyncHistoryDTO, Long, JenkinsSyncHistoryQuery> {


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

    @Override
    public Response<JenkinsSyncHistoryDTO> update(Long aLong, JenkinsSyncHistoryDTO dto) {
        return super.update(aLong, dto);
    }

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

    @Override
    public Response<JenkinsSyncHistoryDTO> findById(Long aLong) {
        return super.findById(aLong);
    }

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

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

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

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

    @Override
    protected void exportData(HttpServletResponse response, List<JenkinsSyncHistoryDTO> data) {
        // TODO: 实现导出逻辑
        log.info("导出Jenkin同步日志数据，数据量：{}", data.size());
    }
} 