<groupId>cn</groupId>
<artifactId>tt</artifactId>
<version>0.0.1-SNAPSHOT</version>
<!-- SpringBoot项目的基础库文件-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<name>tt</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.vesoft</groupId>
<artifactId>client</artifactId>
<version>1.0.0</version>
</dependency>
@SpringBootApplication
//@ServletComponentScan
//@Slf4j
//@Configuration
public class App{
private static Logger logger = LoggerFactory.getLogger(App.class);
private static final String UNIQUE_ID = "trace_uuid";
private static final int i = 1;
public static void main( String[] args ) throws TException
{
// UUID uuid = UUID.randomUUID();
// String uniqueId = uuid.toString().replace("-", "");
MDC.put(UNIQUE_ID, uniqueId);
// MDC.put(UNIQUE_ID, uniqueId);
//
GraphClient client = new GraphClientImpl("127.0.0.1", 3699);
client.setUser("user");
client.setPassword("password");
client.connect();
int code = client.switchSpace("space_test");
int code2 = client.execute("CREATE TAG course(name string, credits int);");
logger.debug("cip start begin ...");
// SpringApplication.run(App.class, args);
SpringApplication app = new SpringApplication();
app.run(App.class, args);
logger.debug("cip start end ...");
}
}