http://thrift.apache.org/
下载thrift-0.6.0
安装看README
需java,要下载ant,加入到path
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#支持注释#,/***/,//
# Thrift Tutorial
# Mark Slee (mcslee@facebook.com)
#
# This file aims to teach you how to use Thrift, in a .thrift file. Neato. The
# first thing to notice is that .thrift files support standard shell comments.
# This lets you make your thrift file executable and include your Thrift build
# step on the top line. And you can place comments like this anywhere you like.
#
# Before running this file, you will need to have installed the thrift compiler
# into /usr/local/bin.
#类型定义
/**
* The first thing to know about are types. The available types in Thrift are:
*
* bool Boolean, one byte
* byte Signed byte
* i16 Signed 16-bit integer
* i32 Signed 32-bit integer
* i64 Signed 64-bit integer
* double 64-bit floating point value
* string String
* binary Blob (byte array)
* map<t1,t2> Map from one type to another
* list<t1> Ordered list of one type
* set<t1> Set of unique elements of one type
*
* Did you also notice that Thrift supports C style comments?
*/
// Just in case you were wondering... yes. We support simple C comments too.
/**
* Thrift files can reference other Thrift files to include common struct
* and service definitions. These are found using the current path, or by
* searching relative to any paths specified with the -I compiler flag.
*
* Included objects are accessed using the name of the .thrift file as a
* prefix. i.e. shared.SharedObject
*/
include "shared.thrift"
/**
* Thrift files can namespace, package, or prefix their output in various
* target languages.
*/
namespace cpp tutorial
namespace java tutorial
namespace php tutorial
namespace perl tutorial
/**
* Thrift lets you do typedefs to get pretty names for your types. Standard
* C style here.
*/
typedef i32 MyInteger
/**
* Thrift also lets you define constants for use across languages. Complex
* types and structs are specified using JSON notation.
*/
const i32 INT32CONSTANT = 9853
const map<string,string> MAPCONSTANT = {'hello':'world', 'goodnight':'moon'}
/**
* You can define enums, which are just 32 bit integers. Values are optional
* and start at 1 if not supplied, C style again.
*/
enum Operation {
ADD = 1,
SUBTRACT = 2,
MULTIPLY = 3,
DIVIDE = 4
}
/**
* Structs are the basic complex data structures. They are comprised of fields
* which each have an integer identifier, a type, a symbolic name, and an
* optional default value.
*
* Fields can be declared "optional", which ensures they will not be included
* in the serialized output if they aren't set. Note that this requires some
* manual management in some languages.
*/
struct Work {
1: i32 num1 = 0,
2: i32 num2,
3: Operation op,
4: optional string comment,
}
/**
* Structs can also be exceptions, if they are nasty.
*/
exception InvalidOperation {
1: i32 what,
2: string why
}
/**
* Ahh, now onto the cool part, defining a service. Services just need a name
* and can optionally inherit from another service using the extends keyword.
*/
service Calculator extends shared.SharedService {
/**
* A method definition looks like C code. It has a return type, arguments,
* and optionally a list of exceptions that it may throw. Note that argument
* lists and exception lists are specified using the exact same syntax as
* field lists in struct or exception definitions.
*/
void ping(),
i32 add(1:i32 num1, 2:i32 num2),
i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch),
/**
* This method has a oneway modifier. That means the client only makes
* a request and does not listen for any response at all. Oneway methods
* must be void.
*/
oneway void zip()
}
/**
* That just about covers the basics. Take a look in the test/ folder for more
* detailed examples. After you run this file, your generated code shows up
* in folders with names gen-<language>. The generated code isn't too scary
* to look at. It even has pretty indentation.
*/
参考
分享到:
相关推荐
沙度
基于prometheus官方插件nodeexporter修改
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
opengl
【大厂面试专栏】一份Java程序员需要的技术指南,这里有面试题、系统架构、职场锦囊、主流中间件等,让你成为更牛的自己!_technology-talk
乘用车碟刹刹车片,全球前25强生产商排名及市场份额(by QYResearch).docx
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
各省、自治区、直辖市社会发展各领域_中国社会统计年鉴数据2006-2021年-最新出炉.zip
KWDB 是一款面向 AIoT 场景的分布式多模数据库产品,支持在同一实例同时建立时序库和关系库并融合处理多模数据,具备千万级设备接入、百万级数据秒级写入、亿级数据秒级读取等时序数据高效处理能力,具有稳定安全、高可用、易运维等特点。
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
配置好的vim配置文件,拿来就可以使用,可以快速搜索代码以及文件,函数跳转等,完全可以当一个ide使用。配置文件中都有自己写的中文注释,不懂的可以看注释。
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
原文链接:https://blog.csdn.net/zsd12379/article/details/141302581 包含功能: 用户管理:实现用户注册、登录、权限分配及个人信息管理,确保系统访问的安全性。 球员管理:维护球员的基本信息、职业生涯数据、伤病记录等,支持查询与统计分析。 赛程信息管理:记录比赛的日程安排、对阵双方、比赛结果及场地信息,便于赛事组织与追踪。 国家队管理:管理国家队的成员名单、教练团队、历史战绩及国际排名,支持队伍分析与比较。 新闻资讯管理:发布篮球相关的新闻、公告,包括赛事报道、球员动态等,支持内容编辑与审核。 新闻分类管理:对新闻资讯进行分类维护,如赛事新闻、球员专访、技术分析等,便于用户按需浏览。 在线留言管理:提供用户留言功能,收集用户反馈与建议,支持管理员回复与处理,增强用户互动。
可盈保险合同管理系统项目描述 可盈保险合同管理系统是为了满足保险行业对合同管理的精细化、高效化需求而设计的。该系统集成了多个功能模块,旨在帮助保险公司及其代理人更好地管理保险合同,提高工作效率和客户满意度。 系统主要包含以下功能: 首页:作为系统的入口,首页提供了系统的概览和导航功能,方便用户快速了解系统的整体布局和各个功能模块。 个人中心:用户可以在此模块中查看和管理自己的个人信息,包括账户安全、个人信息设置等,提高个性化体验。 修改密码:为了提高账户的安全性,系统允许用户随时修改自己的密码,确保账户不被非法入侵。 基础数据管理:该功能用于管理系统所需的基础数据,如客户信息、保险产品信息等,为其他模块提供数据支持。 公告信息管理:系统支持发布和查看公告信息,方便用户及时了解公司的最新动态和政策变化。 用户管理:管理员可以通过此模块对用户进行管理和审核,确保系统的用户都是合法和可信的。 客户管理:该功能用于管理客户的信息和需求,包括客户的基本信息、购买历史等,有助于销售人员更好地了解客户需求,提高销售效率。 合同管理:系统支持合同的录入、修改、查询和统计等功能,确保合同的准确性
BookChat-v2.4.zip
工业微焦点X射线管.docx
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
ROHS-电器电子产品有害物质限制使用自愿性认证实施规则
典型卷积神经网络.pptx