mirror of https://github.com/alibaba/arthas.git
transform command: echo, version
parent
62c47c4259
commit
c654abafed
@ -0,0 +1,29 @@
|
||||
package com.taobao.arthas.core.command.model;
|
||||
|
||||
/**
|
||||
* @author gongdewei 2020/5/11
|
||||
*/
|
||||
public class EchoModel extends ResultModel {
|
||||
|
||||
private String content;
|
||||
|
||||
public EchoModel() {
|
||||
}
|
||||
|
||||
public EchoModel(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "echo";
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.taobao.arthas.core.command.model;
|
||||
|
||||
public class VersionModel extends ResultModel {
|
||||
|
||||
private String version;
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "version";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.taobao.arthas.core.command.view;
|
||||
|
||||
import com.taobao.arthas.core.command.model.EchoModel;
|
||||
import com.taobao.arthas.core.shell.command.CommandProcess;
|
||||
|
||||
/**
|
||||
* @author gongdewei 2020/5/11
|
||||
*/
|
||||
public class EchoView extends ResultView<EchoModel> {
|
||||
@Override
|
||||
public void draw(CommandProcess process, EchoModel result) {
|
||||
process.write(result.getContent()).write("\n");
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.taobao.arthas.core.command.view;
|
||||
|
||||
import com.taobao.arthas.core.command.model.VersionModel;
|
||||
import com.taobao.arthas.core.shell.command.CommandProcess;
|
||||
|
||||
/**
|
||||
* @author gongdewei 2020/3/27
|
||||
*/
|
||||
public class VersionView extends ResultView<VersionModel> {
|
||||
|
||||
@Override
|
||||
public void draw(CommandProcess process, VersionModel result) {
|
||||
writeln(process, result.getVersion());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue