commit get version

master
luoyang 6 years ago
parent b84e75478f
commit 7733d8b59d

@ -27,4 +27,6 @@ public interface ManageAppService {
JSONObject clientDetail(JSONObject device, String clientMoniker);
JSONObject getNewVersion(JSONObject device);
}

@ -13,6 +13,7 @@ import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.device.ManageDeviceSupport;
import au.com.royalpay.payment.tools.device.support.DeviceRegister;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
@ -109,5 +110,35 @@ public class ManageAppServiceImp implements ManageAppService {
return manageDeviceTokenMapper.findByDevId(dev_id);
}
@Override
public JSONObject getNewVersion(JSONObject device) {
String version = device.getString("version");
String clientType = device.getString("client_type");
manageDeviceSupport.findRegister(clientType);
String newAppVersion = PlatformEnvironment.getEnv().getNewVersion(clientType);
Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType);
String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType);
int update_type = 0;// 0:不更新 1更新 2强制更新
String[] oldVersion = version.split("\\.");
String[] newVersion = newAppVersion.split("\\.");
JSONObject res = new JSONObject();
res.put("update_content", updateContent);
for (int i = 0; i < newVersion.length; i++) {
if (Integer.valueOf(newVersion[i]) > Integer.valueOf(oldVersion[i])) {
update_type = 1;
if (isUpdate) {
update_type = 2;
}
res.put("update_type", update_type);
return res;
} else if (Integer.valueOf(newVersion[i]) < Integer.valueOf(oldVersion[i])) {
res.put("update_type", update_type);
return res;
}
}
res.put("update_type", update_type);
return res;
}
}

@ -75,6 +75,11 @@ public class ManageAppController {
return manageAppService.clientDetail(device, clientMoniker);
}
@RequestMapping(value = "/version", method = RequestMethod.GET)
public JSONObject getAppVersion(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) {
return manageAppService.getNewVersion(device);
}
}

@ -24,7 +24,6 @@
</ul>
<h4>补充说明</h4>
<ul style="color:red">
<li >退款成功的订单不计入合伙人提成内</li>
<li>当本月有合伙人手续费存在欠款时,无法下载汇款文件</li>
</ul>
</div>

Loading…
Cancel
Save