|
|
@ -33,197 +33,211 @@ import java.util.UUID; |
|
|
|
@RequestMapping("v1/appsubsetversion") |
|
|
|
public class AppSubsetVersionRest implements AppSubsetVersionFeign { |
|
|
|
|
|
|
|
public static final String LINKSID = "147694bb-c765-4426-8f67-d19a66585f31"; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ApkUtil apkUtil; |
|
|
|
@Autowired |
|
|
|
private AppSubsetVersionService appSubsetVersionService; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<List<AppSubsetVersionVo>> selectVersionList() { |
|
|
|
//主框架sid
|
|
|
|
String linkSid = LINKSID; |
|
|
|
String path = fileUploadComponent.getUrlPrefix(); |
|
|
|
List<AppSubsetVersionVo> appSubsetVersionVoList = appSubsetVersionService.selectVersionList(linkSid,path); |
|
|
|
return new ResultBean<List<AppSubsetVersionVo>>().success().setData(appSubsetVersionVoList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean save(AppSubsetVersionDto dto){ |
|
|
|
if (dto.getType().equals("2")){ |
|
|
|
if (StringUtils.isBlank(dto.getModulePluginName())) { |
|
|
|
return ResultBean.fireFail().setMsg("插件名称不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (dto.getType().equals("2") || dto.getType().equals("3")) { |
|
|
|
if (dto.getMultipartFile() == null) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传文件"); |
|
|
|
} else { |
|
|
|
// 获取文件名
|
|
|
|
String fileName = dto.getMultipartFile().getOriginalFilename(); |
|
|
|
// 获取文件后缀
|
|
|
|
String prefix = fileName.substring(fileName.lastIndexOf(".")); |
|
|
|
if (!prefix.equals(".apk")) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传apk文件"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
AppSubsetVersionOneDto appSubsetVersionOneDto = new AppSubsetVersionOneDto(); |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(dto.getModulePluginName()); |
|
|
|
} else if (dto.getType().equals("3")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} else { |
|
|
|
appSubsetVersionOneDto.setVersionCode(0); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(""); |
|
|
|
appSubsetVersionOneDto.setVersionName(""); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} |
|
|
|
appSubsetVersionOneDto.setAppName(dto.getAppName()); |
|
|
|
appSubsetVersionOneDto.setIconUrl(dto.getIconUrl()); |
|
|
|
appSubsetVersionOneDto.setUpgradeInfo(dto.getUpgradeInfo()); |
|
|
|
appSubsetVersionOneDto.setType(dto.getType()); |
|
|
|
appSubsetVersionOneDto.setSortNo(dto.getSortNo()); |
|
|
|
appSubsetVersionOneDto.setSourceAction(dto.getSourceAction()); |
|
|
|
appSubsetVersionOneDto.setSourcePackage(dto.getSourcePackage()); |
|
|
|
appSubsetVersionOneDto.setAppSid(UUID.randomUUID().toString()); |
|
|
|
appSubsetVersionOneDto.setLinkSid(dto.getLinkSid()); |
|
|
|
ResultBean resultBean = save2(appSubsetVersionOneDto); |
|
|
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean save2(AppSubsetVersionOneDto appSubsetVersionOneDto) { |
|
|
|
AppSubsetVersion appSubsetVersion = new AppSubsetVersion(); |
|
|
|
appSubsetVersionOneDto.fillEntity(appSubsetVersion); |
|
|
|
boolean isSave = appSubsetVersionService.save(appSubsetVersion); |
|
|
|
if (!isSave) { |
|
|
|
return ResultBean.fireFail().setMsg("保存失败"); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("保存成功"); |
|
|
|
} |
|
|
|
public static final String LINKSID = "147694bb-c765-4426-8f67-d19a66585f31"; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ApkUtil apkUtil; |
|
|
|
@Autowired |
|
|
|
private AppSubsetVersionService appSubsetVersionService; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<List<AppSubsetVersionVo>> selectVersionList() { |
|
|
|
//主框架sid
|
|
|
|
String linkSid = LINKSID; |
|
|
|
String path = fileUploadComponent.getUrlPrefix(); |
|
|
|
List<AppSubsetVersionVo> appSubsetVersionVoList = appSubsetVersionService.selectVersionList(linkSid, path); |
|
|
|
return new ResultBean<List<AppSubsetVersionVo>>().success().setData(appSubsetVersionVoList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean save(AppSubsetVersionDto dto) { |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
if (StringUtils.isBlank(dto.getModulePluginName())) { |
|
|
|
return ResultBean.fireFail().setMsg("插件名称不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (dto.getType().equals("2") || dto.getType().equals("3")) { |
|
|
|
if (dto.getMultipartFile() == null) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传文件"); |
|
|
|
} else { |
|
|
|
// 获取文件名
|
|
|
|
String fileName = dto.getMultipartFile().getOriginalFilename(); |
|
|
|
// 获取文件后缀
|
|
|
|
String prefix = fileName.substring(fileName.lastIndexOf(".")); |
|
|
|
if (!prefix.equals(".apk")) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传apk文件"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
AppSubsetVersionOneDto appSubsetVersionOneDto = new AppSubsetVersionOneDto(); |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(dto.getModulePluginName()); |
|
|
|
} else if (dto.getType().equals("3")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} else { |
|
|
|
appSubsetVersionOneDto.setVersionCode(0); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(""); |
|
|
|
appSubsetVersionOneDto.setVersionName(""); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} |
|
|
|
appSubsetVersionOneDto.setAppName(dto.getAppName()); |
|
|
|
appSubsetVersionOneDto.setIconUrl(dto.getIconUrl()); |
|
|
|
appSubsetVersionOneDto.setUpgradeInfo(dto.getUpgradeInfo()); |
|
|
|
appSubsetVersionOneDto.setType(dto.getType()); |
|
|
|
appSubsetVersionOneDto.setSortNo(dto.getSortNo()); |
|
|
|
appSubsetVersionOneDto.setSourceAction(dto.getSourceAction()); |
|
|
|
appSubsetVersionOneDto.setSourcePackage(dto.getSourcePackage()); |
|
|
|
appSubsetVersionOneDto.setAppSid(UUID.randomUUID().toString()); |
|
|
|
appSubsetVersionOneDto.setLinkSid(dto.getLinkSid()); |
|
|
|
ResultBean resultBean = save2(appSubsetVersionOneDto); |
|
|
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean save2(AppSubsetVersionOneDto appSubsetVersionOneDto) { |
|
|
|
AppSubsetVersion appSubsetVersion = new AppSubsetVersion(); |
|
|
|
appSubsetVersionOneDto.fillEntity(appSubsetVersion); |
|
|
|
boolean isSave = appSubsetVersionService.save(appSubsetVersion); |
|
|
|
if (!isSave) { |
|
|
|
return ResultBean.fireFail().setMsg("保存失败"); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("保存成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean update(AppSubsetVersionDto dto) { |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
if (StringUtils.isBlank(dto.getModulePluginName())) { |
|
|
|
return ResultBean.fireFail().setMsg("插件名称不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (dto.getType().equals("2") || dto.getType().equals("3")) { |
|
|
|
if (dto.getMultipartFile() == null) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传文件"); |
|
|
|
} else { |
|
|
|
// 获取文件名
|
|
|
|
String fileName = dto.getMultipartFile().getOriginalFilename(); |
|
|
|
// 获取文件后缀
|
|
|
|
String prefix = fileName.substring(fileName.lastIndexOf(".")); |
|
|
|
if (!prefix.equals(".apk")) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传apk文件"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getAppSid())) { |
|
|
|
return ResultBean.fireFail().setMsg("appSid不能为空"); |
|
|
|
} |
|
|
|
AppSubsetVersionOneDto appSubsetVersionOneDto = new AppSubsetVersionOneDto(); |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(dto.getModulePluginName()); |
|
|
|
} else if (dto.getType().equals("3")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} else { |
|
|
|
appSubsetVersionOneDto.setVersionCode(0); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(""); |
|
|
|
appSubsetVersionOneDto.setVersionName(""); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} |
|
|
|
appSubsetVersionOneDto.setAppName(dto.getAppName()); |
|
|
|
appSubsetVersionOneDto.setIconUrl(dto.getIconUrl()); |
|
|
|
appSubsetVersionOneDto.setUpgradeInfo(dto.getUpgradeInfo()); |
|
|
|
appSubsetVersionOneDto.setType(dto.getType()); |
|
|
|
appSubsetVersionOneDto.setSourceAction(dto.getSourceAction()); |
|
|
|
appSubsetVersionOneDto.setSourcePackage(dto.getSourcePackage()); |
|
|
|
appSubsetVersionOneDto.setAppSid(dto.getAppSid()); |
|
|
|
appSubsetVersionOneDto.setLinkSid(dto.getLinkSid()); |
|
|
|
appSubsetVersionOneDto.setSortNo(dto.getSortNo()); |
|
|
|
ResultBean resultBean = update2(appSubsetVersionOneDto); |
|
|
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean update2(AppSubsetVersionOneDto appSubsetVersionOneDto) { |
|
|
|
AppSubsetVersion appSubsetVersion = new AppSubsetVersion(); |
|
|
|
appSubsetVersionOneDto.fillEntity(appSubsetVersion); |
|
|
|
//查询目前数据库中的最新版本
|
|
|
|
AppSubsetVersionVo appVersionVo = appSubsetVersionService.selectByAppSid(appSubsetVersionOneDto.getAppSid()); |
|
|
|
if (appVersionVo != null) { |
|
|
|
int versionCode = appSubsetVersion.getVersionCode(); |
|
|
|
if (appSubsetVersionOneDto.getType().equals("2") || appSubsetVersionOneDto.getType().equals("3")) { |
|
|
|
if (versionCode <= appVersionVo.getVersionCode()) { |
|
|
|
return ResultBean.fireFail().setMsg("上传的版本不能小于所存在的最新版本号"); |
|
|
|
} |
|
|
|
} |
|
|
|
boolean isSave = appSubsetVersionService.save(appSubsetVersion); |
|
|
|
if (!isSave) { |
|
|
|
return ResultBean.fireFail().setMsg("更新失败"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
boolean isSave = appSubsetVersionService.save(appSubsetVersion); |
|
|
|
if (!isSave) { |
|
|
|
return ResultBean.fireFail().setMsg("更新失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("更新成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<AppSubsetVersionVo> fetchBySid(String sid) { |
|
|
|
AppSubsetVersionVo vo = new AppSubsetVersionVo(); |
|
|
|
AppSubsetVersion appSubsetVersion = appSubsetVersionService.fetchBySid(sid); |
|
|
|
BeanUtil.copyProperties(appSubsetVersion, vo); |
|
|
|
return new ResultBean<AppSubsetVersionVo>().success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<AppSubsetVersionVo> getLastBymodulePluginName(String modulePluginName) { |
|
|
|
AppSubsetVersionVo vo = appSubsetVersionService.getLastBymodulePluginName(modulePluginName); |
|
|
|
if (vo == null) { |
|
|
|
return new ResultBean<AppSubsetVersionVo>().fail(); |
|
|
|
} |
|
|
|
return new ResultBean<AppSubsetVersionVo>().success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<AppSubsetVersionVo> getLastByAppSid(String appSid) { |
|
|
|
AppSubsetVersionVo vo = appSubsetVersionService.getLastByAppSid(appSid); |
|
|
|
if (vo == null) { |
|
|
|
return new ResultBean<AppSubsetVersionVo>().fail(); |
|
|
|
} |
|
|
|
return new ResultBean<AppSubsetVersionVo>().success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean update(AppSubsetVersionDto dto){ |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
if (StringUtils.isBlank(dto.getModulePluginName())) { |
|
|
|
return ResultBean.fireFail().setMsg("插件名称不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (dto.getType().equals("2")|| dto.getType().equals("3")) { |
|
|
|
if (dto.getMultipartFile() == null) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传文件"); |
|
|
|
} else { |
|
|
|
// 获取文件名
|
|
|
|
String fileName = dto.getMultipartFile().getOriginalFilename(); |
|
|
|
// 获取文件后缀
|
|
|
|
String prefix = fileName.substring(fileName.lastIndexOf(".")); |
|
|
|
if (!prefix.equals(".apk")) { |
|
|
|
return ResultBean.fireFail().setMsg("请上传apk文件"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getAppSid())) { |
|
|
|
return ResultBean.fireFail().setMsg("appSid不能为空"); |
|
|
|
} |
|
|
|
AppSubsetVersionOneDto appSubsetVersionOneDto = new AppSubsetVersionOneDto(); |
|
|
|
if (dto.getType().equals("2")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(dto.getModulePluginName()); |
|
|
|
} else if (dto.getType().equals("3")) { |
|
|
|
VersionVo versionVo = apkUtil.apkParser(dto.getMultipartFile()).getData(); |
|
|
|
appSubsetVersionOneDto.setVersionCode(versionVo.getVersionCode()); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(versionVo.getUpdateUrl()); |
|
|
|
appSubsetVersionOneDto.setVersionName(versionVo.getVersionName()); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} else { |
|
|
|
appSubsetVersionOneDto.setVersionCode(0); |
|
|
|
appSubsetVersionOneDto.setUpdateUrl(""); |
|
|
|
appSubsetVersionOneDto.setVersionName(""); |
|
|
|
appSubsetVersionOneDto.setModulePluginName(""); |
|
|
|
} |
|
|
|
appSubsetVersionOneDto.setAppName(dto.getAppName()); |
|
|
|
appSubsetVersionOneDto.setIconUrl(dto.getIconUrl()); |
|
|
|
appSubsetVersionOneDto.setUpgradeInfo(dto.getUpgradeInfo()); |
|
|
|
appSubsetVersionOneDto.setType(dto.getType()); |
|
|
|
appSubsetVersionOneDto.setSourceAction(dto.getSourceAction()); |
|
|
|
appSubsetVersionOneDto.setSourcePackage(dto.getSourcePackage()); |
|
|
|
appSubsetVersionOneDto.setAppSid(dto.getAppSid()); |
|
|
|
appSubsetVersionOneDto.setLinkSid(dto.getLinkSid()); |
|
|
|
appSubsetVersionOneDto.setSortNo(dto.getSortNo()); |
|
|
|
ResultBean resultBean = update2(appSubsetVersionOneDto); |
|
|
|
|
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean update2(AppSubsetVersionOneDto appSubsetVersionOneDto) { |
|
|
|
AppSubsetVersion appSubsetVersion = new AppSubsetVersion(); |
|
|
|
appSubsetVersionOneDto.fillEntity(appSubsetVersion); |
|
|
|
//查询目前数据库中的最新版本
|
|
|
|
AppSubsetVersionVo appVersionVo = appSubsetVersionService.selectByAppSid(appSubsetVersionOneDto.getAppSid()); |
|
|
|
if (appVersionVo != null) { |
|
|
|
int versionCode = appSubsetVersion.getVersionCode(); |
|
|
|
if (appSubsetVersionOneDto.getType().equals("2") || appSubsetVersionOneDto.getType().equals("3")) { |
|
|
|
if (versionCode <= appVersionVo.getVersionCode()) { |
|
|
|
return ResultBean.fireFail().setMsg("上传的版本不能小于所存在的最新版本号"); |
|
|
|
} |
|
|
|
} |
|
|
|
boolean isSave = appSubsetVersionService.save(appSubsetVersion); |
|
|
|
if (!isSave) { |
|
|
|
return ResultBean.fireFail().setMsg("更新失败"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
boolean isSave = appSubsetVersionService.save(appSubsetVersion); |
|
|
|
if (!isSave) { |
|
|
|
return ResultBean.fireFail().setMsg("更新失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("更新成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<AppSubsetVersionVo> fetchBySid(String sid) { |
|
|
|
AppSubsetVersionVo vo = new AppSubsetVersionVo(); |
|
|
|
AppSubsetVersion appSubsetVersion = appSubsetVersionService.fetchBySid(sid); |
|
|
|
BeanUtil.copyProperties(appSubsetVersion, vo); |
|
|
|
return new ResultBean<AppSubsetVersionVo>().success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<AppSubsetVersionVo> getLastBymodulePluginName(String modulePluginName) { |
|
|
|
AppSubsetVersionVo vo = appSubsetVersionService.getLastBymodulePluginName(modulePluginName); |
|
|
|
if (vo == null) { |
|
|
|
return new ResultBean<AppSubsetVersionVo>().fail(); |
|
|
|
} |
|
|
|
return new ResultBean<AppSubsetVersionVo>().success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<AppSubsetVersionVo> getLastByAppSid(String appSid) { |
|
|
|
AppSubsetVersionVo vo = appSubsetVersionService.getLastByAppSid(appSid); |
|
|
|
if (vo == null) { |
|
|
|
return new ResultBean<AppSubsetVersionVo>().fail(); |
|
|
|
} |
|
|
|
return new ResultBean<AppSubsetVersionVo>().success().setData(vo); |
|
|
|
} |
|
|
|
public ResultBean<AppSubVersionVo> selectLast() { |
|
|
|
ResultBean<AppSubVersionVo> rb = ResultBean.fireFail(); |
|
|
|
AppSubVersionVo vo = new AppSubVersionVo(); |
|
|
|
String appSid = "e25e13b5-f2ed-421f-bdb3-6f2eca2a3028"; |
|
|
|
ResultBean<AppSubsetVersionVo> resultBean = getLastByAppSid(appSid); |
|
|
|
AppSubsetVersionVo appSubsetVersionVo = resultBean.getData(); |
|
|
|
BeanUtil.copyProperties(appSubsetVersionVo, vo); |
|
|
|
vo.setModuleVersion(appSubsetVersionVo.getVersionCode()); |
|
|
|
vo.setPath(fileUploadComponent.getUrlPrefix() + appSubsetVersionVo.getUpdateUrl()); |
|
|
|
vo.setModuleAction("com.anrui.android.plugin.autoservice.common.CarlModelConfigDetailActivity"); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
} |
|
|
|