-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
232 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...nkis-cli/src/main/java/org/apache/linkis/cli/application/interactor/job/help/HelpJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.linkis.cli.application.interactor.job.help; | ||
|
||
import org.apache.linkis.cli.application.entity.context.CliCtx; | ||
import org.apache.linkis.cli.application.entity.job.Job; | ||
import org.apache.linkis.cli.application.entity.job.JobResult; | ||
import org.apache.linkis.cli.application.present.HelpPresenter; | ||
import org.apache.linkis.cli.application.present.model.HelpInfoModel; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class HelpJob implements Job { | ||
private CliCtx ctx; | ||
|
||
@Override | ||
public void build(CliCtx ctx) { | ||
this.ctx = ctx; | ||
} | ||
|
||
@Override | ||
public JobResult run() { | ||
HelpInfoModel model = new HelpInfoModel(); | ||
model.buildModel(ctx.getTemplate()); | ||
new HelpPresenter().present(model); | ||
return new JobResult() { | ||
@Override | ||
public Boolean isSuccess() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public Map<String, String> getExtraMessage() { | ||
return new HashMap<>(); | ||
} | ||
}; | ||
} | ||
|
||
@Override | ||
public void onDestroy() {} | ||
} |
48 changes: 48 additions & 0 deletions
48
...li/src/main/java/org/apache/linkis/cli/application/interactor/job/version/VersionJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.linkis.cli.application.interactor.job.version; | ||
|
||
import org.apache.linkis.cli.application.constants.CliKeys; | ||
import org.apache.linkis.cli.application.entity.context.CliCtx; | ||
import org.apache.linkis.cli.application.entity.job.Job; | ||
import org.apache.linkis.cli.application.entity.job.JobResult; | ||
import org.apache.linkis.cli.application.utils.LoggerManager; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class VersionJob implements Job { | ||
private CliCtx ctx; | ||
|
||
@Override | ||
public void build(CliCtx cliCtx) { | ||
this.ctx = cliCtx; | ||
} | ||
|
||
@Override | ||
public JobResult run() { | ||
String version = (String) ctx.getExtraMap().get(CliKeys.VERSION); | ||
Map<String, String> extraMap = new HashMap<>(); | ||
extraMap.put(CliKeys.VERSION, version); | ||
LoggerManager.getPlaintTextLogger().info("Version=" + version); | ||
return new VersionJobResult(true, "ok", extraMap); | ||
} | ||
|
||
@Override | ||
public void onDestroy() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
linkis-computation-governance/linkis-client/linkis-cli/src/main/resources/version.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
cli.version=${project.version} |