code review:会员统计

This commit is contained in:
YunaiV
2023-10-14 01:26:06 +08:00
parent 0eb86ca269
commit 1ac2f2b5c2
24 changed files with 86 additions and 41 deletions

View File

@ -18,8 +18,7 @@ public enum TerminalEnum implements IntArrayValuable {
WECHAT_MINI_PROGRAM(10, "微信小程序"),
WECHAT_WAP(11, "微信公众号"),
H5(20, "H5 网页"),
IOS(31, "苹果 App"),
ANDROID(32, "安卓 App"),
APP(31, "手机 App"),
;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray();

View File

@ -145,18 +145,15 @@ public class AreaUtils {
if (area == null) {
return null;
}
// 匹配到
// 情况一:匹配到,返回它
if (type.getType().equals(area.getType())) {
return area.getId();
}
// 找到根节点,返回空
// 情况二:找到根节点,返回空
if (area.getParent() == null || area.getParent().getId() == null) {
return null;
}
// 继续向上查找
// 其它:继续向上查找
id = area.getParent().getId();
}
return null;