version接口
来源:互联网 发布:中科院外籍院士知乎 编辑:程序博客网 时间:2024/04/28 18:44
发包时候一般需要验证是否正确版本
通过脚本在classes目录下生成一个version.txt文件
并在程序中提供version接口
import java.io.IOException;import java.util.List;import org.apache.commons.io.IOUtils;import org.springframework.core.io.ClassPathResource;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import org.springframework.web.bind.annotation.ResponseBody;import org.springframework.web.bind.annotation.RestController;import com.arcsoft.web.openapi.common.basic.BaseController;@RestController@RequestMapping("/rest/service/version")public class VersionController extends BaseController{@RequestMapping(value = "/versionInfo", method = RequestMethod.GET)@ResponseBodypublic Object versionInfo() throws Exception{ClassPathResource res = new ClassPathResource("version.txt");String ret = "unknown, version.txt does not exist!!!";if(res.exists()){List<String> retList = null;try{retList = IOUtils.readLines(res.getInputStream());ret = retList.get(0);}catch(IOException e){e.printStackTrace();}}return ret;}}
0 0
- version接口
- version
- version
- Version
- version
- @Version
- Version
- Version
- Microsoft ADO Data Control,version 6.0(OLEDB) 不支持此接口
- 根据Pom(groupId,artifactId,version)下载jar包Restful api接口
- @version ||= version
- VERSION { version-script-commands }
- (Win7)中Visual C++在添加ADO控件时出现Microsoft ADO Data Control,version 6.0(OLEDB)不支持此接口
- redis requires Ruby version >= 2.2.2 系统默认 ruby 版本过低,导致 Redis 接口安装失败
- 安装完ruby环境后,安装redis接口时报错:redis requires Ruby version >= 2.2.2.的解决
- Inactive version, active version和generated version
- Remoting & Version
- log4c version
- iPhone/iOS开启个人热点的相关位置调整小结
- 标签页,程序开始导航
- SSL与TLS的区别以及介绍
- Shell集合运算
- 杭电ACM1312(dfs)
- version接口
- 实现按钮拖动到底部,与底部按钮互换的功能
- 从这些方面锻炼成为优秀的软件工程师
- 获取手机所有联系人及搜索
- 总结一下打字
- 自己做得json测试类,包含JSONArray,JSONObject,Gson基本使用方法
- 如何得到线程执行完之后返回的结果
- 第六部分: 大数据监管和信息单一视图监管
- android中坐标系详解