liurunyu
2 天以前 f84d149459b73928c864eb5aebf764cf58105c73
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.dy.pipirrComCreator;
 
import com.dy.pipirrComCreator.console.CommandConsole;
import org.springframework.stereotype.Component;
 
import java.io.Console;
 
/**
 * @Author: liurunyu
 * @Date: 2025/5/6 18:02
 * @Description
 */
@Component
public class Server {
    public void startServer() throws Exception{
        Console console = System.console();
        if (console == null) {
            throw new Exception("严重错误,未能得到控制台对象!");
        }
        CommandConsole mwConsole = new CommandConsole(console) ;
        mwConsole.init();
        boolean exit = mwConsole.clientConsole() ;
        if(exit){
            System.exit(-1);
        }
    }
}