1 下载
http://thrift.apache.org/
下载exe版本
2 改文件名,放到文件夹(无需安装)
3 配置环境变量
4 cmd使用
5 新建thrift文件
demo.thrift,namespace是命名空间
namespace java com.my.thrift.demo
namespace py thrift.demo
service DemoService{
void sayHello(1:string name);
}
6 生成java文件
thrift --gen java demo.thrift
thrift --gen java -out ../ demo.thrift
项目实战–windows
demo.thrift
namespace java com.war.demo
service DemoService{
void sayHello(1:string name);
}
go.bat
thrift --gen java -out ../src/main/java demo.thrift