package cn.reghao.autodop.common.beans;

import cn.reghao.autodop.common.machine.Machine;
import cn.reghao.autodop.common.machine.Cpu;
import cn.reghao.autodop.common.machine.Memory;
import cn.reghao.autodop.common.machine.Os;
import cn.reghao.jdkutil.text.TextFile;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author reghao
 * @date 2021-09-16 09:28:04
 */
@Configuration
public class BeansConfig {
    @Bean
    public TextFile textFile() {
        return new TextFile();
    }

    @Bean
    public Machine machine() {
        return new Machine(os(), cpu(), memory());
    }

    @Bean
    public Os os() {
        return new Os(textFile());
    }

    @Bean
    public Cpu cpu() {
        return new Cpu(textFile());
    }

    @Bean
    public Memory memory() {
        return new Memory(textFile());
    }
}
