package za.co.taulite.tools.smppclient;
|
|
import org.jline.utils.AttributedString;
|
import org.jline.utils.AttributedStyle;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.context.event.EventListener;
|
import org.springframework.shell.jline.PromptProvider;
|
import org.springframework.stereotype.Component;
|
//import za.co.taulite.mshell.events.MSLoginEvent;
|
//import za.co.taulite.mshell.services.MSAuthService;
|
import za.co.taulite.tools.smppclient.services.SmppService;
|
|
import javax.annotation.PostConstruct;
|
|
@Component
|
public class MSPromptProvider implements PromptProvider {
|
|
@Autowired
|
private SmppService smppService;
|
|
private String systemId = "";
|
|
@PostConstruct
|
public void init() {
|
// if (authService.isLoggedIn()) {
|
// this.username = authService.getUser().getUsername();
|
// }
|
}
|
|
// @EventListener
|
// public void onLogin(MSLoginEvent loginEvent) {
|
// this.username = loginEvent.getUsername() == null ? "" : loginEvent.getUsername();
|
// }
|
|
@Override
|
public AttributedString getPrompt() {
|
//return new AttributedString(String.format("ยต %s$ ", username), AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW));
|
return new AttributedString("$ ");
|
}
|
}
|