-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareTest.java
More file actions
44 lines (26 loc) · 1.01 KB
/
CompareTest.java
File metadata and controls
44 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.chen.test;
import org.apache.commons.lang3.StringUtils;
import java.util.Objects;
/**
* @author : chen weijie
* @Date: 2019-07-16 19:07
*/
public class CompareTest {
public static void main(String[] args) {
System.out.println(getIfShowStudyPlan("4.1.9","CS_APP_IOS"));
System.out.println(getIfShowStudyPlan("4.2.0.3","CS_APP_ANDROID"));
}
private static boolean getIfShowStudyPlan(String appVersion, String channelCode) {
if (StringUtils.isBlank(appVersion) || StringUtils.isBlank(channelCode)) {
return false;
}
// 由于app端兼容性问题,ios的版本小于等于4.1.8的不展示学习打卡的活动页。安卓的版本小于4.2.0.1
if (Objects.equals(channelCode, "CS_APP_IOS") && appVersion.compareTo("4.1.8") <= 0) {
return false;
}
if (Objects.equals(channelCode, "CS_APP_ANDROID") && appVersion.compareTo("4.2.0.1") <= 0) {
return false;
}
return true;
}
}