lang2idl v0.0.7
What is it?
this is a tool for create a json idl(interface description lanauge) from groovy/java/c# etc, and convert idl to typescript/java/groovy/c# etc.
How use?
1、install:
npm install:
npm install -g lang2idl
or
git clone git@github.com:nofdev/lang2idl.git cd lang2idl npm link #this command will create a link to current folder.
2、use
create json idl from groovy:
groovy2idl "groovy files or dir path" // the files path is not must if current folder had groovy files.
create json idl from c#:
cs2idl "cs files or dir path" // the files path is not must if current folder had cs files.
Before execute commands below, you need change the json idl file name as a package name, for example:nofdev-userfacade.
create typescript from json idl:
idl2ts "json idl file path" // the json idl file path is must.
create groovy from json idl:
idl2groovy "json idl file path" // the json idl file path is must.
create cs from json idl:
idl2cs "json idl file path" // the json idl file path is must.
3、publish:
After convert json idl to lang file, you can publish it to npmjs/nuget/maven repository, then other developer can use it as a package.
npm package:
cd npm-package npm build npm publish
About code document
Standard code:
/** * 换绑手机号(没有关联护照的账号,可以正常绑定手机号和修改绑定的手机号 * @description 1.判断手机号是否已绑定网账号,如果已绑定,不能换绑 * @description 2.判断手机号是否是护照 * @description 2.1. 如果是护照,验证护照手机号+验证码登录的逻辑,换绑网手机号、绑定护照 * @description 2.2. 如果不是护照,验证网换绑手机号的短信验证,走网换绑手机号的逻辑 * @author MengQiang * @param mobile 换绑后的手机号 eg.13411011011 * @param smsVerificationCode 短信验证码 eg.888888 * @param smsTokenId 短信验证码TokenId * */ void changeBindingMobileForMe(String mobile, String smsVerificationCode,String smsTokenId);Ï
The comments that not start with '@' is method's comments. Start with '@author' is the author of code block. Start with '@param' are args comments, and the eg.xxx is for test value. Start with '@return' is the method return result comments.
About import
If import other package, must not use '*' in import code line, because the converter need match the custom type's package, use '*' can't match it nicety.
About property(groovy)
Property code must end with ';' for split property code block in groovy.
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago