package com.fs.fssync.config;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Data
@NoArgsConstructor
@Component
@ConfigurationProperties(prefix = "flink")
public class FlinkConfig {
    private CdcConfig cdc = new CdcConfig();
    private CheckpointConfig checkpoint = new CheckpointConfig();
    private ParallelismConfig parallelism = new ParallelismConfig();

    @Data
    @NoArgsConstructor
    public static class CdcConfig {
        private MySqlConfig mysql = new MySqlConfig();
    }

    @Data
    @NoArgsConstructor
    public static class MySqlConfig {
        private String hostname;
        private int port;
        private String databaseList;
        private String[] tableList;
        private String username;
        private String password;
        private String serverTimeZone;
        private String startupOptions;
    }

    @Data
    @NoArgsConstructor
    public static class CheckpointConfig {
        private int interval;
    }

    @Data
    @NoArgsConstructor
    public static class ParallelismConfig {
        private int source;
        private int sink;
    }
}
