commit b01671d7f35913ba2a2a0c28fddabbf656e6c32b Author: linbin <4961397@qq.com> Date: Mon Sep 2 21:46:56 2024 +0800 初始化项目结构,包括基本的文件和目录设置 此次提交创建了项目的基本文件和目录结构,涵盖了.gitignore文件、源代码的初始Java类、一个测试文件、一个配置文件(tianhe.yml)、以及Maven的项目对象模型(pom.xml)。这为项目的进一步开发打下了基础。 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..27f1e2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +#过滤target文件下生成的编译文件 +target/ +.project +.settings/ +.metadata/ +.classpath +*.MF + +.idea +*.iml \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d7768ec --- /dev/null +++ b/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + org.example + tianhe + 1.0-SNAPSHOT + jar + + tianhe + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + diff --git a/src/main/java/org/tianhe/App.java b/src/main/java/org/tianhe/App.java new file mode 100644 index 0000000..0a55073 --- /dev/null +++ b/src/main/java/org/tianhe/App.java @@ -0,0 +1,13 @@ +package org.tianhe; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/main/java/org/tianhe/common/Command.java b/src/main/java/org/tianhe/common/Command.java new file mode 100644 index 0000000..a02b337 --- /dev/null +++ b/src/main/java/org/tianhe/common/Command.java @@ -0,0 +1,39 @@ +package org.tianhe.common; + +public interface Command +{ + /** + * 命令名称 + * + * @return + */ + CommandName name(); + + /** + * 环境 id + * + * @return + */ + String envId(); + + /** + * 项目id,等同于节点 id + * + * @return + */ + String agentId(); + + /** + * 命令唯一标识 + * + * @return + */ + String commandId(); + + /** + * 采用 jfireSE 进行序列化,然后使用 Base64编码后存储,方便于 http 传输。 + * + * @return + */ + String content(); +} diff --git a/src/main/java/org/tianhe/common/CommandName.java b/src/main/java/org/tianhe/common/CommandName.java new file mode 100644 index 0000000..cafec9c --- /dev/null +++ b/src/main/java/org/tianhe/common/CommandName.java @@ -0,0 +1,6 @@ +package org.tianhe.common; + +public enum CommandName +{ + +} diff --git a/src/test/java/org/tianhe/AppTest.java b/src/test/java/org/tianhe/AppTest.java new file mode 100644 index 0000000..8932f79 --- /dev/null +++ b/src/test/java/org/tianhe/AppTest.java @@ -0,0 +1,38 @@ +package org.tianhe; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/tianhe.yml b/tianhe.yml new file mode 100644 index 0000000..691f34f --- /dev/null +++ b/tianhe.yml @@ -0,0 +1,34 @@ +Operation: + enable: true + download: + prefix: http://localhost:2000 + datasource: + url: jdbc:mysql://localhost:3306/operation?useUnicode=true&characterEncoding=utf8&useSSL=false&&allowPublicKeyRetrieval=true + username: root + password: root +Agent: + enable: true + duration: + report: 100000 + next_command: 1000 + download: + mode: 2 + size: 524288 + upload: + size: 5242880 + app: + cloudApp: + url: http://localhost:10081/cloudApp/endpoint + port: 10081 + hosApp: + url: http://localhost:10086/config/endpoint + port: 10086 + operation: + url: http://localhost:39999/api + env: + envId: TestId + agentId: 1 + datasource: + url: jdbc:mysql://localhost:3306/chsdrg?useUnicode=true&characterEncoding=utf8&useSSL=false&&allowPublicKeyRetrieval=true + username: root + password: root \ No newline at end of file