package com.artfess.rescue.external.controller;

import com.artfess.base.annotation.ApiGroup;
import com.artfess.base.constants.ApiGroupConsts;
import com.artfess.rescue.external.manager.SyncRoadCheckManger;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author: wsf
 * @Description: 一键救援-同步一周内的巡检任务及详情任务
 * @DateTime: 2025/5/14 15:48
 **/

@RestController
@RequestMapping("/event/v1")
@ApiGroup(group = {ApiGroupConsts.GROUP_BIZ_RESCUE})
@Api(tags = "首讯-接收阳光救援信息")
public class SyncRoadCheckController {

    @Resource
    private SyncRoadCheckManger syncRoadCheckManger;

    @GetMapping("/sync")
    @ApiOperation(value = "同步一周内的巡检任务及详情任务", notes = "同步一周内的巡检任务及详情任务")
    public void syncEvent() {
        syncRoadCheckManger.syncEvent();
    }

    @PostMapping("/test")
    @ApiOperation(value = "同步一周内的巡检任务及详情任务", notes = "同步一周内的巡检任务及详情任务")
    public void test(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime) {
        syncRoadCheckManger.test(startTime,endTime);
    }

    @PostMapping("/test1")
    @ApiOperation(value = "同步一周内的巡检任务及详情任务", notes = "同步一周内的巡检任务及详情任务")
    public void test1() {
        syncRoadCheckManger.saveDistinctBatchs();
    }

}
