新增App版本信息查询

master
gongzhenkun 2 years ago
parent a21d03ce67
commit 4455fd3966

@ -700,4 +700,18 @@ public class AppController extends BaseController
BeanUtils.copyProperties(appPatientRecordReq, tRecordResultReq);
return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(tRecordResultReq));
}
/**
*
*
* @return {@code AjaxResult}
*/
@ApiOperation("APP查询版本信息")
@Log(title = "APP查询版本信息", businessType = BusinessType.OTHER)
@GetMapping("/version/info")
public AjaxResult queryVersionInformation(){
String localPath = RuoYiConfig.getProfile();
String file = FileUtils.readJsonFile(localPath + "appVersion.json");
return AjaxResult.success(JSONObject.parseObject(file));
}
}

@ -44,6 +44,7 @@ public class LoginFilter implements Filter {
filterUrlList.add("/api/app/doctor/info");
filterUrlList.add("/api/app/patient/info");
filterUrlList.add("/api/app/patient/modify");
filterUrlList.add("/api/app/version/info");
if (!filterUrlList.contains(currentUrl)) {
LoginUser loginUser = userTokenService.getLoginUser((HttpServletRequest) servletRequest);

@ -1,12 +1,6 @@
package com.ruoyi.common.utils.file;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
@ -345,4 +339,31 @@ public class FileUtils
throw new ServiceException("Base64转图片错误,message is " + e.getMessage());
}
}
/**
* json
*
* @param Filename
* @return {@code String}
*/
public static String readJsonFile(String Filename) {
String jsonStr = "";
try {
File jsonFile = new File(Filename);
FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8);
int ch;
StringBuilder sb = new StringBuilder();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
jsonStr = sb.toString();
return jsonStr;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}

Loading…
Cancel
Save