package com.njcn.relational.controller;

import com.njcn.relational.pojo.dto.DcloudSyncQuery;
import com.njcn.relational.service.DcloudBusService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: cdf
 * @CreateTime: 2026-06-17
 * @Description:
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/bus")
public class DcloudBusController {

    private final DcloudBusService dcloudBusService;

    @GetMapping("/sync1")
    public void syncData() {
        DcloudSyncQuery query = DcloudSyncQuery.buildPlantDefault(null, null, null, null);
        dcloudBusService.syncDataToDb(query);
    }

    @GetMapping("/sync2")
    public void syncData2() {
        DcloudSyncQuery query = DcloudSyncQuery.buildPlantChangZhan(null, null, null, null);
        dcloudBusService.syncDataToDb(query);
    }

    @GetMapping("/sync3")
    public void syncData3() {
        DcloudSyncQuery query = DcloudSyncQuery.buildPlantBdB(null, null, null, null);
        dcloudBusService.syncDataToDb(query);
    }

    @GetMapping("/sync4")
    public void syncData4() {
        DcloudSyncQuery query = DcloudSyncQuery.buildPlantBdC(null, null, null, null);
        dcloudBusService.syncDataToDb(query);
    }

    @GetMapping("/sync5")
    public void syncData5() {
        DcloudSyncQuery query = DcloudSyncQuery.buildSgConPlantBNewenergy(null, null, null, null);
        dcloudBusService.syncDataToDb(query);
    }

    @GetMapping("/sync6")
    public void syncData6() {
        DcloudSyncQuery query = DcloudSyncQuery.buildSgSgDevAclineB(null, null, null, null);
        dcloudBusService.syncDataToDb(query);
    }
}
