简单封装 Thrift 协议

build.gradle 文件

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plugins {
    id("com.linecorp.thrift-gradle-plugin") version "0.5.0"
}

dependencies {
    api('org.apache.thrift:libthrift:0.19.0')
    api('org.springframework.boot:spring-boot-starter-logging')
    api('cn.hutool:hutool-all')

    testImplementation('org.springframework.boot:spring-boot-starter-test')
}

example.thrift 文件

文件放在路径: src/main/thrift, 运行 gradle 命令 compileThrift