Nebula springboot Demo

  <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 ...");
        
    }
    
   
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值