ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 组件源码 ``` /** * @category MD5计算签名,指定文件 * @param contants * 入参|文件名称 * * @return -1 异常<br/> * 0 失败<br/> * 1 成功<br/> */ @InParams(param = { @Param(name = "fileName", comment = "待编码文件名称(字符串))", type = java.lang.String.class) }) @OutParams(param = { @Param(name = "md5txt", comment = "MD5签名内容", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) @Component(label = "MD5计算签名", style = "判断型", type = "同步组件", comment="计算指定文件的MD5签名", version = "1.0.0", deprecated = false, date = "2018-01-19 04:46:50") public static ResultBase P_md5Enc(String fileName) { if (fileName == null) { return ResultBase.newFailureResult("TPTF0038", "待编码内容不能为空"); } try { File file = new File(fileName); return ResultBase.newSuccessResult(getMd5ByFile(file)); } catch (Exception ex) { AppLog.error(ex); return ResultBase.newExceptionResult("TPTF0039", "计算MD5异常:" + AppLog.errorMsg(ex)); } } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/f2/81/f281e41413fe7159156b3bb754d8f5ef_1868x891.png) # 参数说明及示例 ## 入口参数 待编码文件名称(字符串)):传入一个绝对路径,示例: `"D:\\work\\CQYY\\workspace\\abc.txt"` ## 出口参数 MD5签名内容:返回文件的MD5签名,示例: `__INNER__["result"]`