package com.sino.mci.channel.controller;

import com.sino.mci.channel.entity.SyncTask;
import com.sino.mci.channel.service.SyncTaskService;
import com.sino.mci.shared.web.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sync-task")
@RequiredArgsConstructor
public class SyncTaskController {

    private final SyncTaskService syncTaskService;

    @GetMapping("/{id}")
    public ApiResponse<SyncTask> getTask(
            @RequestHeader("X-Tenant-Code") String tenantCode,
            @PathVariable("id") Long id) {
        return ApiResponse.ok(syncTaskService.getTask(id, tenantCode));
    }
}
